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

fix citext resolution issues #1629

Merged
merged 3 commits into from
Jun 7, 2023
Merged

fix citext resolution issues #1629

merged 3 commits into from
Jun 7, 2023

Conversation

ryan-berger
Copy link
Contributor

@ryan-berger ryan-berger commented May 19, 2022

Fixes #1581 .

I just added citext to the switch so that it would resolve to string, although this might not be the best solution.

I looked around, and it seems that hstore has similar code and since hstore and citext both are extensions that live in pg_catalog this seems to be in the spirit of the previous solutions.

@ryan-berger ryan-berger marked this pull request as draft May 19, 2022 02:16
@ryan-berger ryan-berger marked this pull request as ready for review May 19, 2022 02:16
@ryan-berger
Copy link
Contributor Author

Apologies if I jumped the gun on this one since it is still in triage.

I was experiencing the issue as well, so I thought I'd submit a PR.

Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test case? There are many examples inside internal/endtoend/testdata.

@ryan-berger
Copy link
Contributor Author

@kyleconroy I've added a few e2e tests, sorry it took me so long to get around to this. This should be good to go

@colbee1
Copy link

colbee1 commented May 21, 2023

Cannot use sqlc because of citext not supported as string. Is there a chance to see patch merged soon ?

@kyleconroy kyleconroy merged commit edc1e5a into sqlc-dev:main Jun 7, 2023
@kyleconroy
Copy link
Collaborator

kyleconroy commented Jun 7, 2023

@colbee1 This will be released in v1.19.0, which is slated for July.

@yujinio
Copy link

yujinio commented Jun 15, 2023

@colbee1 I think for now you could just use the following (I actually use this override):

version: "2"
sql:
  - engine: "postgresql"
    schema: ...
    queries: ...
    gen:
      go:
        out: ...
        overrides:
          - db_type: "citext"
            go_type: "string"

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.

citext on column resulted to interface{} as type
4 participants