Skip to content

Handle user defined types #986

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

Closed
ludusrusso opened this issue Apr 28, 2021 · 2 comments
Closed

Handle user defined types #986

ludusrusso opened this issue Apr 28, 2021 · 2 comments
Labels
📚 postgresql enhancement New feature or request future In the year 3000...

Comments

@ludusrusso
Copy link
Contributor

I'd like to use sqlc with user defined types in Postgres.

For instance, if I provide a schema like this:

CREATE TYPE FOO as (
  foo text
);

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text,
  foo FOO
);

I'd expect an output model like that

type Foo struct {
  foo sql.NullString
}

type Author struct {
   ID   int64
   Name string
   Bio  sql.NullString
   Foo  *Foo
}​

Do you think this is feasible?

If for you this is ok I can try to do a PR on it!

@kyleconroy kyleconroy added enhancement New feature or request future In the year 3000... labels Sep 12, 2021
@kyleconroy
Copy link
Collaborator

@ludusrusso No current plans to support user defined types. I'd love to, but there's a lot of other lower hanging fruit that needs to be worked on first.

@kyleconroy
Copy link
Collaborator

Tracking via #2760

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

No branches or pull requests

2 participants