Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support for multiple schemas in type generating #3061

Copy link
Copy link
@jljl1337

Description

@jljl1337
Issue body actions

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

GeekyMonkey, jljl1337 and raffidahmad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.