supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
662 stars 155 forks source link

Custom schema usage error #840

Closed andim27 closed 4 months ago

andim27 commented 4 months ago

Describe the bug Try use custom schema which was created from rpc call in dynamic mode Get an error: PostgrestException(message: The schema must be one of the following: public, storage, graphql, realtime, code: PGRST106, details: Not Acceptable, hint: null) I/flutter (11846): #0 PostgrestBuilder._parseResponse (package:postgrest/src/postgrest_builder.dart:283:7) I/flutter (11846): #1 PostgrestBuilder._execute (package:postgrest/src/postgrest_builder.dart:164:14) I/flutter (11846): I/flutter (11846): #2 PostgrestBuilder.then (package:postgrest/src/postgrest_builder.dart:372:24) I/flutter (11846):

To Reproduce

  1. init supabase client
  2. call rpc( which create custom schema with name (customSchema) + make all grants(USAGE, PRIVILEGES)
  3. make call: await sbClient.schema(customSchema).from(....)
  4. get error from supabase flutter
Vinzent03 commented 4 months ago

The schema has to be added to postgrest as well. Best to follow the documentation. Though, I think it's generally uncommon to create whole new schema from rpc.