supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
965 stars 129 forks source link

.in() filter maximum filter size receives "URI too long" error #423

Closed danrasmuson closed 1 year ago

danrasmuson commented 1 year ago

Bug report

In the below query pdfIds.length is 800 items long. This causes the query to fail.

    supabase
      .from('pdfs')
      .select('*')
      .in('id', pdfIds)

The error is...

{ message: 'URI too long\n' }

Expected behavior

I would expect supabase to make use of the POST body of requests and not just append filters onto the URI. This would allow for these longer queries.

steve-chavez commented 1 year ago

Thanks for the report. For now as a workaround you can use an RPC. RPC uses POST, you can send an big array there and pass it to a SQL query(with col = ANY(<parameter>).

I would expect supabase to make use of the POST body of requests and not just append filters onto the URI.

Yes, we're planning to switch to the HTTP SEARCH method. This will be transparent to the supabase-js functions.

Related https://github.com/supabase/postgrest-js/issues/292

soedirgo commented 1 year ago

Closing in favor of https://github.com/supabase/postgrest-js/issues/393