-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat(postgrest)!: stronger type system for query building #624
Conversation
This should be ready now 🚀 await postgrest.from('users').select('*').head(); I've made it |
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.
This looks amazing! I had a few small questions here and there, but nothing major! Thanks for the awesome work 🚀
Other than the head thing, everything should be fixed |
What kind of change does this PR introduce?
feature
What is the current behavior?
The type system makes everything dynamic, which is not very efficient. Additionally, the way a method argument changes the overall return type is not very darty.
What is the new behavior?
By changing the api and class structure, everything is perfectly typed.
Before
After
Breaking points
FetchOptions
is removed fromselect
etc. and made to stand alone methodsAdditional context
The pr turned bigger than expected, but I think it's real magic how the return type perfectly changes by adding
single
andwithConverter
etc. So I think it's worth it.