Skip to content

feat(typegen): Go Type Gen #687

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

Merged
merged 12 commits into from
May 24, 2024

Conversation

isaacharrisholt
Copy link
Contributor

@isaacharrisholt isaacharrisholt commented Jan 10, 2024

What kind of change does this PR introduce?

Feature

What is the current behaviour?

No Go types

What is the new behaviour?

This PR adds type generation for Go based on the proposal in this discussion.

There's also some cleanup in server.ts for local development, which a) crosses off a TODO comment and b) makes it simpler to extend with new type generators later.

Additional context

This PR requires #685 to be merged first and currently contains the changes from that PR. If you're interested in the changes made by this one, I recommend looking at commits b24e63d onwards, which mostly touch these files:

  • */go.ts
  • server.ts
  • routes.ts
  • package.json

Still TODO:

  • Handle composite types
  • Handle range types
  • Tests

Let me know your feedback or if you'd like any changes :)

@isaacharrisholt isaacharrisholt marked this pull request as ready for review January 11, 2024 19:18
@isaacharrisholt isaacharrisholt requested review from a team as code owners January 11, 2024 19:18
@isaacharrisholt isaacharrisholt changed the title DRAFT: feat(typegen): Go Type Gen feat(typegen): Go Type Gen Jan 11, 2024
@isaacharrisholt
Copy link
Contributor Author

Going to mark this as draft for now - I've decided it might be better to separate out the Select, Insert and Update models (as in JS) and make use of the sql.Null* types in the standard library

@isaacharrisholt isaacharrisholt marked this pull request as draft March 12, 2024 08:36
@isaacharrisholt
Copy link
Contributor Author

I've now done the above, so this should be ready to go

@isaacharrisholt isaacharrisholt marked this pull request as ready for review March 21, 2024 09:59
@isaacharrisholt isaacharrisholt force-pushed the feat/go_typegen_types branch from db43f73 to f10acb5 Compare May 18, 2024 12:31
@soedirgo soedirgo enabled auto-merge (squash) May 24, 2024 10:39
@soedirgo soedirgo merged commit 9b6a6af into supabase:master May 24, 2024
4 checks passed
@soedirgo soedirgo mentioned this pull request May 28, 2024
avallete pushed a commit that referenced this pull request May 13, 2025
* feat(typegen): add route for go

* feat(typegen): cleanup server.ts and set up local typegen for go

* feat(typegen): create go table structs

* feat(typegen): create go view/matview structs

* feat(typegen): create go composite type structs

* feat(typegen): go: handle range types

* feat(typegen): go: test

* feat(typegen): go: format

* feat(typegen): separate go types by operation and add nullable types

* feat(typegen): go: format

* feat(typegen): go: handle empty tables

* chore: update snapshot

---------

Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
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.

2 participants