version: "2" sql: - engine: "postgresql" queries: "internal/pkg/store/postgres/queries" schema: "internal/pkg/store/postgres/migrations" gen: go: package: "sqlc" out: "internal/pkg/store/postgres/sqlc" sql_package: "pgx/v5" emit_interface: true emit_json_tags: false emit_pointers_for_null_types: true emit_db_tags: false overrides: # TypeID columns: stored as text in Postgres but surfaced as typed # Go wrappers so Go code cannot mix an OrgID with a PinID. - column: "orgs.id" go_type: "anchorage/internal/pkg/ids.OrgID" - column: "users.id" go_type: "anchorage/internal/pkg/ids.UserID" - column: "memberships.org_id" go_type: "anchorage/internal/pkg/ids.OrgID" - column: "memberships.user_id" go_type: "anchorage/internal/pkg/ids.UserID" - column: "api_tokens.jti" go_type: "anchorage/internal/pkg/ids.TokenID" - column: "api_tokens.org_id" go_type: "anchorage/internal/pkg/ids.OrgID" - column: "api_tokens.user_id" go_type: "anchorage/internal/pkg/ids.UserID" - column: "nodes.id" go_type: "anchorage/internal/pkg/ids.NodeID" - column: "pins.request_id" go_type: "anchorage/internal/pkg/ids.PinID" - column: "pins.org_id" go_type: "anchorage/internal/pkg/ids.OrgID" - column: "pin_placements.request_id" go_type: "anchorage/internal/pkg/ids.PinID" - column: "pin_placements.node_id" go_type: "anchorage/internal/pkg/ids.NodeID" - column: "pin_refcount.node_id" go_type: "anchorage/internal/pkg/ids.NodeID" - column: "audit_log.org_id" go_type: "anchorage/internal/pkg/ids.OrgID" - column: "audit_log.actor_user_id" go_type: "anchorage/internal/pkg/ids.UserID"