Skip to content

feat: add typings for functions returning table #469

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

Closed

Conversation

jsbrain
Copy link

@jsbrain jsbrain commented Jan 17, 2023

What kind of change does this PR introduce?

Fixes #468

@jsbrain jsbrain requested a review from a team as a code owner January 17, 2023 17:48
@jsbrain jsbrain changed the title fix: #468 feat: add typings for functions returning table Jan 17, 2023
@soedirgo
Copy link
Member

Hey, thanks! There's actually a bug in return_type - I'll fix that and then come back to this PR.

@jsbrain
Copy link
Author

jsbrain commented Jan 20, 2023

Yeah I also realized meanwhile that my code doesn't work reliably. If you have 2 tables with the same name in 2 different schemas you would have the chance to get the typings of the wrong table in the "other" schema.

For this to work properly there would have to be more information in the return_type, like public.users instead of users or there might be another way to infer this correctly but I'm not sure.

@soedirgo
Copy link
Member

Yep, the plan is to add a return_type_id field, so we can disambiguate which table is referred exactly.

@jsbrain
Copy link
Author

jsbrain commented Jan 20, 2023

Sounds like a plan 👍🏻

@soedirgo
Copy link
Member

Closing in favor of #500

@soedirgo soedirgo closed this Feb 14, 2023
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.

Typings for functions returning setof <table>
2 participants