Skip to content

citext on column resulted to interface{} as type #1581

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
vijaynallagatla opened this issue May 2, 2022 · 2 comments · Fixed by #1629
Closed

citext on column resulted to interface{} as type #1581

vijaynallagatla opened this issue May 2, 2022 · 2 comments · Fixed by #1629

Comments

@vijaynallagatla
Copy link

vijaynallagatla commented May 2, 2022

Version

Other

What happened?

Version
Other

What happened?
Hint: I am using v1.13.0 with PostgreSQL DB to generate the Go code.

Looks like the citext column type is resulted to interface{} whereas it should be String or sql.NullString

Result:

type AddNameParams struct {
	Name interface{}
}

Expectation:

type AddNameParams struct {
	Name string
}

Type citext should be supported as a String

Relevant log output

No response

Database schema

CREATE TABLE IF NOT EXISTS temp(id uuid NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(), name citext NOT NULL)

SQL queries

INSERT INTO (name) VALUES('name')

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@vijaynallagatla vijaynallagatla added bug Something isn't working triage New issues that hasn't been reviewed labels May 2, 2022
@vijaynallagatla vijaynallagatla changed the title postgres: citext on column resulted to interface{} as type PostgreSQL/Go: citext on column resulted to interface{} as type May 2, 2022
@kyleconroy kyleconroy added 📚 postgresql 🔧 golang 💻 darwin and removed triage New issues that hasn't been reviewed labels Jun 4, 2022
@kyleconroy kyleconroy changed the title PostgreSQL/Go: citext on column resulted to interface{} as type citext on column resulted to interface{} as type Jun 4, 2022
@flymedllva
Copy link
Contributor

Why doesn't this option work as a crutch?

        overrides:
          - db_type: "pg_catalog.citext"
            go_type: "string"

@ryan-berger
Copy link
Contributor

@flymedllva That's what I am using for our production codebase.

However, #1629 should bring it more inline with the Python implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants