-
Notifications
You must be signed in to change notification settings - Fork 295
feat: support custom query timeout for type gen #4082
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
Conversation
Pull Request Test Coverage Report for Build 17260823135Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It really shouldn’t take that much time though 🤔
If you have a reproducible example (a database schema) that triggers this issue, I’d be happy to create an issue on the postgres-meta side. There’s probably some performance bottleneck we could investigate and optimize in such cases.
@avallete I have a supabase project that can reproduce the timeout. How can I share it with you privately? |
Hey ! Thank's for reaching out ! Yes I have. This allowed us to pinpoint that the cause of the issue was a bug in the introspection queries performed that postgres-meta, those only filter by schema/entity at the end of the query, constructing the CTE for all of the objects, before filtering out only the ones it needs. |
Awesome! Yes this matches what we observed on our end. The more schemas we have the longer the generation takes even when we apply the schema filters. Look forward to the release. |
Hey @yilinjuang Just a quick update that the new version of echo "v0.91.6" > supabase/.temp/pgmeta-version Before running your local stack, this should fix your local npx supabase gen types --lang typescript --local > database.generated.ts Would love to hear if it solve your use case or any feedbacks. |
What kind of change does this PR introduce?
feature
What is the new behavior?
Allow custom timeout because type gen queries on large databases could take longer than the default 15s.
Additional context
Add any other context or screenshots.