Complete the code to fetch the first 10 rows from the 'products' table.
const { data, error } = await supabase.from('products').select('*').limit([1]);Using limit(10) fetches the first 10 rows, which is a common page size for pagination.
Complete the code to fetch the next 10 rows after skipping the first 10.
const { data, error } = await supabase.from('products').select('*').range([1], 19);The range(10, 19) fetches rows starting from index 10 to 19, which is the second page of 10 rows.
Fix the error in the code to fetch the next page using a cursor with 'id' greater than the last fetched id.
const { data, error } = await supabase.from('products').select('*').gt('id', [1]).limit(10);The variable lastId should be used without quotes to refer to its value, not as a string.
Fill both blanks to fetch the third page of 10 rows using range pagination.
const { data, error } = await supabase.from('orders').select('*').range([1], [2]);The third page starts at index 20 and ends at 29 for 10 rows per page.
Fill all three blanks to fetch rows where 'created_at' is after a date, ordered by 'created_at' descending, limited to 5 rows.
const { data, error } = await supabase.from('events').select('*').[1]('created_at', 'gt', lastDate).[2]('created_at', { ascending: false }).limit([3]);gt directly without filter.Use filter('created_at', 'gt', date) to filter dates after a value, then order('created_at', { ascending: false }) to sort descending, and limit(5) to get 5 rows.