sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

go/sqlite: integer primary keys are inferred as nullable when declared separately

Open darkfeline opened this issue 1 year ago • 0 comments

Version

1.25.0

What happened?

When a sqlite integer primary key is declared in a separate line, the generated type is nullable even though sqlite constrains the type to not null.

Relevant log output

No response

Database schema

CREATE TABLE foo (
    aid INTEGER,
    PRIMARY KEY (aid)
)

SQL queries

No response

Configuration

version: "2"
sql:
- engine: "sqlite"
  schema: "schema.sql"
  queries: "query.sql"

Playground URL

https://play.sqlc.dev/p/508b178450774b28762380c31ae03d768098ee4e6c3082570fe23d01486a9955

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

darkfeline avatar Jan 10 '24 09:01 darkfeline