# sqlc — type-safe Go from SQL (plan SG17). `make generate` regenerates.
#
# Scope: API read/mutation paths use sqlc-generated queries
# (internal/db/sqlcgen). The seed ingest and YAML export intentionally stay
# hand-written pgx: they are generic bulk upserts driven by parsed YAML
# shapes, where sqlc's static typing adds nothing.
version: "2"
sql:
  - engine: "postgresql"
    schema: "migrations"
    queries: "internal/db/queries"
    strict_order_by: false
    gen:
      go:
        package: "sqlcgen"
        out: "internal/db/sqlcgen"
        sql_package: "pgx/v5"
        emit_pointers_for_null_types: true
        overrides:
          - db_type: "uuid"
            go_type:
              import: "github.com/google/uuid"
              type: "UUID"
          - db_type: "uuid"
            nullable: true
            go_type:
              import: "github.com/google/uuid"
              type: "UUID"
              pointer: true
          - db_type: "timestamptz"
            go_type:
              import: "time"
              type: "Time"
          - db_type: "timestamptz"
            nullable: true
            go_type:
              import: "time"
              type: "Time"
              pointer: true
