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
{{ message }}
Repository navigation
sqlc not accepting go type overrides for timestamp with timezone on postgres #3815
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"
Activity
kyleconroy commentedon Feb 10, 2025
I believe this is fixed by #3811