Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple schemas in type generating #3061

Open
jljl1337 opened this issue Jan 21, 2025 · 0 comments
Open

Support for multiple schemas in type generating #3061

jljl1337 opened this issue Jan 21, 2025 · 0 comments

Comments

@jljl1337
Copy link

Is your feature request related to a problem? Please describe.
I am writing a web application using Next.js and typescript. I have a private schema for my backend with a table note, I ran the supabase gen types command with the -s flag, but when i want to use the table type in my logic, it was resolved as unknown type:

Image

When I try to debug, I found this line in the generated file:

type PublicSchema = Database[Extract<keyof Database, "public">];

When I change "public" to "private", the table type can be referred.

It seems that only the tables from the public schema can be referred, it would be much better if tables from all schemas can be referred, especially when the schema(s) is/are specified when generating the types.

Describe the solution you'd like
The correct table (and enum) type of all the generated schemas should be able to be referred, especially when the schema(s) is/are specified when generating the types.

Describe alternatives you've considered
Mentioned the expected outcome and/or any alternate solution in the document of the CLI

Additional context
N/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant