supabase / postgres-meta

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
https://supabase.com
Apache License 2.0
881 stars 116 forks source link

feat(typegen): Go Type Gen #687

Closed isaacharrisholt closed 3 months ago

isaacharrisholt commented 8 months ago

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:

Still TODO:

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

isaacharrisholt commented 6 months ago

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 commented 5 months ago

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