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

[Feature request]: Generate Kotlin types from Database #647

Open
2 tasks done
iruizmar opened this issue Jul 6, 2024 · 3 comments
Open
2 tasks done

[Feature request]: Generate Kotlin types from Database #647

iruizmar opened this issue Jul 6, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@iruizmar
Copy link
Contributor

iruizmar commented Jul 6, 2024

General Info

  • I installed the latest version of Supabase Kt
  • I checked for similar feature requests

Feature request

This is a feature present in typescript SDK and it's so useful.
We could use KSP for this.

Usecase

No response

@iruizmar iruizmar added the enhancement New feature or request label Jul 6, 2024
@jan-tennert
Copy link
Collaborator

jan-tennert commented Jul 6, 2024

So I think calling the API for every build/sync is not a good idea. So maybe we have a separate command/gradle task for retrieving the database types and saving them in a file (JSON or some other file format). Then on the normal builds, the ksp annotation processor reads this data and generates these classes. This would also solve compatibility issues, where database changes are not yet present in the app.

@jan-tennert jan-tennert self-assigned this Jul 7, 2024
@grdsdev
Copy link
Contributor

grdsdev commented Jul 9, 2024

I added type generation for Swift a couple of weeks ago, still in beta, supabase/postgres-meta#779 and it isn't as powerful as typescript types, for now, it just generates a plain Swift struct that mimics the DB schema.

@jan-tennert
Copy link
Collaborator

I added type generation for Swift a couple of weeks ago, still in beta, supabase/postgres-meta#779 and it isn't as powerful as typescript types, for now, it just generates a plain Swift struct that mimics the DB schema.

Yea, I asked about that on Slack, so I'll look into that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants