Skip to content

Column type string does not return error #1917

Closed

Description

@mohdrasbi

Version

1.15.0

What happened?

When a create a table with a column type string, which is not a postgres datatype:

create table test_table (
    id string
);

the sqlc code generator does not return any errors. It generates a field in Go with type string.

However, when the migration is applied, an error is returned since the datatype string does not exist in postgres.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/377ff1e3c1bac823de845bd66dbffbee9ed4bb328e63f7c291297c6d256c7112

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Activity

  1. added
    bugSomething isn't working
    triageNew issues that hasn't been reviewed
    on Oct 28, 2022
  2. kyleconroy commented on Oct 24, 2023

    @kyleconroy
    Collaborator

    This is fixed in v1.23.0 by enabling the database-backed query analyzer. We added a test case for this issue so it won’t break in the future.

    You can play around with the working example on the playground

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions