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

Column type string does not return error #1917

Closed
mohdrasbi opened this issue Oct 28, 2022 · 1 comment
Closed

Column type string does not return error #1917

mohdrasbi opened this issue Oct 28, 2022 · 1 comment

Comments

@mohdrasbi
Copy link

mohdrasbi commented Oct 28, 2022

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

@mohdrasbi mohdrasbi added bug Something isn't working triage New issues that hasn't been reviewed labels Oct 28, 2022
@kyleconroy kyleconroy added 📚 postgresql 🔧 golang and removed triage New issues that hasn't been reviewed labels Nov 9, 2022
kyleconroy added a commit that referenced this issue Oct 17, 2023
kyleconroy added a commit that referenced this issue Oct 18, 2023
* fix(compiler): Pull in array information from analyzer
Fixes #1532
* test(analyzer): Add testcase for #1574
* test: Added test for #1634
* test: Add test case for #1646
* test: Add test for #1714
* Fixes #1912
* test: Add case for #1916
* test: Add two test cases
#1917
#1545
* test: Add case for #1979
* test: Add case for #1990
@kyleconroy
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants