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

fix(typegen): handle missing public schema #723

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

sweatybridge
Copy link
Contributor

@sweatybridge sweatybridge commented Feb 20, 2024

What kind of change does this PR introduce?

supersedes #717

What is the current behavior?

If public schema is not requested, the generated type fails to compile.

What is the new behavior?

When public schema is not requested, Tables<'name'> is now typed as unknown.

To use any non-public schema, pass in explicitly to Tables<{ schema: 'private' }, 'name'>.

Additional context

Add any other context or screenshots.

@sweatybridge sweatybridge requested review from a team as code owners February 20, 2024 10:06
Co-authored-by: yingw787 <me@yingw787.com>
@yingw787
Copy link
Contributor

I just ran PG_META_GENERATE_TYPES_INCLUDED_SCHEMAS=openai PG_META_DB_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres npm run gen:types:typescript | xclip -sel clip and it works for me, so I'm happy with this!

@soedirgo soedirgo merged commit c018e8f into master Feb 20, 2024
4 checks passed
@soedirgo soedirgo deleted the missing-public branch February 20, 2024 18:03
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

Successfully merging this pull request may close these issues.

3 participants