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

Supabase CLI: supabase gen types —lang=go non-functional #31312

Open
David-Botos opened this issue Dec 23, 2024 · 6 comments
Open

Supabase CLI: supabase gen types —lang=go non-functional #31312

David-Botos opened this issue Dec 23, 2024 · 6 comments
Labels
bug Something isn't working external-issue to-triage

Comments

@David-Botos
Copy link

Bug report

  • [ X ] I confirm this is a bug with Supabase, not with my own application.
  • [ X ] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Running

supabase gen types --linked --lang=go

throws:
Unable to generate go types for selected project. Try using --db-url flag instead.

and

supabase gen types --lang=go --db-url=postgresql://postgres:postgres@127.0.0.1:54322/postgres

throws:
supabase start is not running.

Supabase start is running, and I checked immediately after using both docker ps and supabase status.

Under the same conditions, with no additional configuration, running:

supabase gen types typescript --linked

works just fine, so it appears this is isolated to just generating Go types.

To Reproduce

These are the steps I took exactly:

  1. create a Supabase project in the dashboard
  2. init and link the db using the CLI
  3. use supabase db pull to get the migration sql file
  4. rename the migration sql file to seed.sql and place in the supabase directory
  5. run supabase db reset to get the seed file applied
  6. run the commands described above

Expected behavior

described above

System information

  Model Name: MacBook Pro
  Model Identifier: Mac14,10
  Model Number: MNW83LL/A
  Chip: Apple M2 Pro
  Total Number of Cores: 12 (8 performance and 4 efficiency)
  Memory: 16 GB
  System Firmware Version: 10151.121.1
  OS Loader Version: 10151.121.1

supabase cli v2.1.1 (latest as of 12/23)

@David-Botos David-Botos added the bug Something isn't working label Dec 23, 2024
@silentworks
Copy link
Contributor

Where did you find reference to the CLI generating go types? as far as I'm aware it only generates Typescript types at the moment.

@FFX3
Copy link

FFX3 commented Dec 29, 2024

Where did you find reference to the CLI generating go types? as far as I'm aware it only generates Typescript types at the moment.

In the comments on line 96

https://github.com/supabase/cli/blob/main/cmd/gen.go

This should probably be on the supabase-cli repo.

@FFX3
Copy link

FFX3 commented Dec 29, 2024

At line 41 the tool returns the same error if the lang is not typescript.

I think, this just isn't implemented yet.

https://github.com/supabase/cli/blob/develop/internal/gen/types/types.go

@David-Botos
Copy link
Author

It is also defined in the documentation that Typescript, Go, and Swift types can be generated https://supabase.com/docs/reference/cli/supabase-gen-types @silentworks

I ended up taking a manual approach, but this would be an awesome feature. If I have additional time, I’ll look into the links @FFX3 shared and see if I can figure out how to implement / finish implementing.

From what I have seen @isaacharrisholt was working on it on this branch: https://github.com/isaacharrisholt/postgres-meta/tree/feat/go_typegen_types

@silentworks
Copy link
Contributor

@David-Botos thanks for pointing that out. I didn't even realize they added more languages.

@isaacharrisholt
Copy link

It is also defined in the documentation that Typescript, Go, and Swift types can be generated https://supabase.com/docs/reference/cli/supabase-gen-types @silentworks

I ended up taking a manual approach, but this would be an awesome feature. If I have additional time, I’ll look into the links @FFX3 shared and see if I can figure out how to implement / finish implementing.

From what I have seen @isaacharrisholt was working on it on this branch: https://github.com/isaacharrisholt/postgres-meta/tree/feat/go_typegen_types

I've not touched this for a while. I can't remember if it got merged or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external-issue to-triage
Projects
None yet
Development

No branches or pull requests

4 participants