version: "2"
sql:
  - engine: "postgresql"
    schema: "./database/schema/postgres.sql"
    queries: "./database/query/postgres/"
    gen:
      go:
        package: "postgres"
        out: "models/postgres"
        sql_package: "database/sql"
        emit_db_tags: true
        emit_json_tags: true
        emit_empty_slices: true
        emit_pointers_for_null_types: true
  - engine: "sqlite"
    schema: "./database/schema/sqlite.sql"
    queries: "./database/query/sqlite/"
    gen:
      go:
        package: "sqlite"
        out: "models/sqlite"
        sql_package: "database/sql"
        emit_db_tags: true
        emit_json_tags: true
        emit_empty_slices: true
        emit_pointers_for_null_types: true
overrides:
  go:
    rename:
      id: "Identifier"
    overrides:
      - engine: "postgresql"
        nullable: true
        db_type: "timestamptz"
        go_type:
          type: "time.Time"
          pointer: true
      - engine: "postgresql"
        unsigned: false
        db_type: "pg_catalog.int4"
        go_type: "int64"
