sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

NOT NULL is ignored in DOMAIN

Open mdigger opened this issue 1 year ago • 0 comments

Version

1.25.0

What happened?

NOT NULL is ignored in DOMAIN

Relevant log output

No response

Database schema

CREATE DOMAIN title AS varchar NOT NULL DEFAULT '';
CREATE TABLE test (
    id serial PRIMARY KEY,
    title title
);

SQL queries

-- name: SelectAll :many
select * from test;

Configuration

version: "2"
sql:
  - engine: "postgresql"
    queries: "query.sql"
    schema: "schema.sql"
    gen:
      go:
        out: "./ttt"
        sql_package: "pgx/v5"
        overrides:
          - db_type: "title"
            nullable: true
            go_type: "github.com/jackc/pgx/v5/pgtype.Text"
          - db_type: "title"
            go_type: "string"

Playground URL

https://play.sqlc.dev/p/164ea8947584b51714552b380447dbd0eb1e5cc7cf93ea0b4c2429c7096d862c

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

mdigger avatar Mar 11 '24 22:03 mdigger