← All errors · SupabaseSupabase database & RLS errors

Supabase select returns only 1,000 rows (no error)

What you see

A supabase.from(...).select() call comes back with at most 1,000 rows. Official Supabase docs do not quote any error text for this, because they describe it as a maximum number of rows returned, not as an error. This page does not invent one. In a Lovable, Bolt, or Cursor app, a list or export that should have more than 1,000 items simply stops at 1,000 and looks stale or incomplete.

What it means

This often shows up in Lovable, Bolt, and Cursor apps when a generated list, table, or export calls select() once and assumes every matching row came back. The official JavaScript select() reference says that by default, Supabase projects return a maximum of 1,000 rows. That limit is a project API setting, and official docs recommend keeping it low to limit the payload size of accidental or malicious requests. Locally, the Supabase CLI config names the same setting api.max_rows and defaults it to 1,000; it is the maximum number of rows returned from a view, table, or function. The way official docs tell you to read more rows is to paginate with range().

See also: official Supabase guide: JavaScript: select.

Likely causes

How to fix it

  1. Page through results with .range(from, to). The range() reference says from and to are 0-based and inclusive, and that the range respects the query order (without an order clause it can behave unexpectedly). Loop until a page comes back shorter than the page size:

    const pageSize = 1000
    let from = 0
    const allRows = []
    
    while (true) {
      const { data, error } = await supabase
        .from('items')
        .select('*')
        .order('id')
        .range(from, from + pageSize - 1)
    
      if (error) throw error
      if (!data?.length) break
      allRows.push(...data)
      if (data.length < pageSize) break
      from += pageSize
    }
  2. Detect a truncated response with select('*', { count: 'exact' }). The select() reference says that when you use count with .range() or .limit(), the returned count is the total number of rows that match your filters, not the number of rows in the current page. If data.length is smaller than count, more rows exist than this response returned:

    const { data, error, count } = await supabase
      .from('items')
      .select('*', { count: 'exact' })
    
    if (error) throw error
    if (count != null && data.length < count) {
      // This response did not include every matching row.
      // Page through the rest with range().
    }
  3. If you still need a higher cap, change the setting in your project's API settings (Dashboard: Settings > API Settings). Official docs recommend keeping it low to limit the payload size of accidental or malicious requests. On a local project, that setting is api.max_rows in supabase/config.toml, which defaults to 1,000.

  4. If Lovable, Bolt, or Cursor built the query, paste this so it pages instead of assuming one select() returns every row:

    My supabase.from(...).select() list or export stops at 1,000 rows and shows no error. Official Supabase docs say projects return a maximum of 1,000 rows by default. Page through results with .range(from, to) in a loop: from and to are 0-based and inclusive, and add .order() first because range() can behave unexpectedly without an order clause. Use select('*', { count: 'exact' }) and compare data.length to count to detect when results were cut off. Only raise the max-rows setting in the project's API settings if needed, and keep it low.

Still stuck after trying this? Get it fixed for $49, or you don't pay.

Prevent this next time

FAQ

What does "Supabase select returns only 1,000 rows (no error)" mean?

This often shows up in Lovable, Bolt, and Cursor apps when a generated list, table, or export calls select() once and assumes every matching row came back. The official JavaScript select() reference says that by default, Supabase projects return a maximum of 1,000 rows. That limit is a project API setting, and official docs recommend keeping it low to limit the payload size of accidental or malicious requests. Locally, the Supabase CLI config names the same setting api.max_rows and defaults it to 1,000; it is the maximum number of rows returned from a view, table, or function. The way official docs tell you to read more rows is to paginate with range().

What usually causes it?

The project uses the default maximum of 1,000 rows, so a select() without paging returns at most that many. The app treats one select() response as the full result, so a list or export stops at 1,000 items. Official docs do not describe an error for this cap, so nothing obvious flags that more rows exist.

How do I fix it?

1. Page through results with .range(from, to). The range() reference says from and to are 0-based and inclusive, and that the range respects the query order (without an order clause it can behave unexpectedly). Loop until a page comes back shorter than the page size: 2. Detect a truncated response with select('*', { count: 'exact' }). The select() reference says that when you use count with .range() or .limit(), the returned count is the total number of rows that match your filters, not the number of rows in the current page. If data.length is smaller than count, more rows exist than this response returned: 3. If you still need a higher cap, change the setting in your project's API settings (Dashboard: Settings > API Settings). Official docs recommend keeping it low to limit the payload size of accidental or malicious requests. On a local project, that setting is api.max_rows in supabase/config.toml, which defaults to 1,000. 4. If Lovable, Bolt, or Cursor built the query, paste this so it pages instead of assuming one select() returns every row:

Last checked against official docs on . Sources: Supabase docs: JavaScript select(), Supabase docs: JavaScript range(), Supabase docs: CLI config (api.max_rows).

Related errors

More Supabase errors and fixes →

Tools that help

  • Railway: Deploy backends and databases; new users get $20 credit.

Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy