-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Creating typed Client from supabase openapi schema #584
Comments
Related: supabase/postgrest-py#301 This feature has been on my mind for sometime, but the DX won't be as good as it is with typescript just due to limitations of the Python type system (for example, selecting only a few columns would be almost impossible to reflect in the returned type) |
Ah yeah that's true. Typescript is definitely more powerful than the Python type system. Didn't think of all those dynamic select statements. |
I went with a different solution for my use case. Since python runs server side then connecting directly to the database is often a viable solution (instead of using postgrest api). So I went with Prisma Client Python. Ie. I used Prisma CLI to generate It's probably a different scope than the scope of |
This is currently a nice to have but outside the scope of this project at the moment. Solution mention by NixBiks can be used if types are absolutely necessary for your project. |
Is your feature request related to a problem? Please describe.
Currently the python client isn't typed based on the data model. It makes a bit "wild wild west". Using the generated OpenAPI schema it should be possible to generate a typed blient.
Describe the solution you'd like
I think it would be great to have similar support in Python as there is in Typescript currently. On the Typescript side of things, it is possible to generate a typed Client
Additional context
It might be useful to get some inspiration from
openapi-python-client
The text was updated successfully, but these errors were encountered: