You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sqlc doesn't generate models based on the type overrides found in the configuration sqlc.yaml. It doesn't accept the go type override for time.Time when the postgres type in the schema is a timestamp with time zone, but accepts it when the postgres type is defined using the short hand timestamptz.
Relevant log output
Database schema
-- doesn't work for this table as the generated model has a created_at pgtype.Timestamptz fieldCREATETABLEtest (
id serial,
created_at timestamp with time zonenot null
);
-- works for this table as the generated model has a created_at time.Time fieldCREATETABLEtest2 (
id serial,
created_at timestamptznot null
);
SQL queries
Configuration
version: "2"sql:
- engine: "postgresql"schema: "./database/schema.sql"queries: "./database/query"gen:
go:
emit_json_tags: truepackage: "bloc"out: "database/sqlc/bloc"sql_package: "pgx/v5"overrides:
# Override PostgreSQL "timestamptz" to Go's time.Time# Doesn't work if the `db_type` is replaced with timestamp with time zone either
- db_type: "timestamptz"go_type: "time.Time"
Version
1.28.0
What happened?
Sqlc doesn't generate models based on the type overrides found in the configuration
sqlc.yaml
. It doesn't accept the go type override for time.Time when the postgres type in the schema is atimestamp with time zone
, but accepts it when the postgres type is defined using the short handtimestamptz
.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/2b3c34a2cbb6b39c97097dd41b5dba87ac45eeeae192be8e0e40e225405d6527
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: