goose migration 0001 lands the twelve State Store tables on Postgres, and sqlc generates the task queries from it. Two behaviours that genuinely differ from SQLite are pinned by tests against a real PG 18: claiming takes the oldest queued row with FOR UPDATE SKIP LOCKED (without the clause a second claimer blocks, which the test shows by timing out), and every column behind a Go int is bigint -- SQLite's INTEGER is 64-bit, and the chat issue-number allocator seeds at 10^15, which does not fit an int4. task db:generate writes the committed postgresdb package; task db:check regenerates it in the gate, as proto:check and ui:check do. The remaining store methods (events, resources, identities, the status tables) still run on SQLite: porting them is the rest of archie-core-7r0x.2.
19 lines
606 B
YAML
19 lines
606 B
YAML
version: "2"
|
|
sql:
|
|
- engine: "postgresql"
|
|
schema: "migrations"
|
|
queries: "queries"
|
|
gen:
|
|
go:
|
|
package: "postgresdb"
|
|
out: "postgresdb"
|
|
sql_package: "pgx/v5"
|
|
# The store's list methods return nil for an empty result and its
|
|
# callers test that; empty slices here would be a silent change.
|
|
emit_empty_slices: false
|
|
overrides:
|
|
# The domain carries every timestamp as time.Time; pgtype would put
|
|
# a .Time unwrap at each of the mapping sites instead.
|
|
- db_type: "timestamptz"
|
|
go_type: "time.Time"
|