sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

fix citext resolution issues

Open ryan-berger opened this issue 3 years ago • 1 comments

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 avatar May 19 '22 01:05 ryan-berger

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.

ryan-berger avatar May 19 '22 02:05 ryan-berger

@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

ryan-berger avatar Sep 28 '22 01:09 ryan-berger

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

colbee1 avatar May 21 '23 14:05 colbee1

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

kyleconroy avatar Jun 07 '23 20:06 kyleconroy

@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"

yujinio avatar Jun 15 '23 18:06 yujinio