Persistence uses sqlc: SQL in internal/infrastructure/postgres/queries/*.sql is compiled into ~6,200 lines of generated Go in postgresdb/, used by 15 files. That needs the sqlc tool in tools/go.mod, sqlc.yaml, task db:generate and the db:check gate step, and a regenerate step on every query change. The maintainer prefers plain SQL migrations plus sqlx.
Change:
Keep the goose migrations (internal/infrastructure/postgres/migrations) as the schema source.
Move each query into the store method that uses it, as a SQL string executed with sqlx (Get/Select/NamedExec over structs with db tags), in place of the generated postgresdb calls.
Delete postgresdb/, queries/, sqlc.yaml, the sqlc tool dependency, task db:generate and the db:check step in task check.
Remove sqlc from CLAUDE.md's generated-files rule.
Do it store file by store file; behaviour must not change. The State Store SQL semantics (transition guards, idempotent dispatch, cancellation) are a listed test seam: add a test only where a converted query actually breaks.
Acceptance criteria
No sqlc dependency, config or generated code remains; every store method runs its own SQL through sqlx; task check passes without db:check; the State Store starts against a migrated database and serves tasks.
Imported from beads archie-core-1rwj · GitHub #1332 · type task · priority P2 · created 2026-10-03
Persistence uses sqlc: SQL in internal/infrastructure/postgres/queries/*.sql is compiled into ~6,200 lines of generated Go in postgresdb/, used by 15 files. That needs the sqlc tool in tools/go.mod, sqlc.yaml, task db:generate and the db:check gate step, and a regenerate step on every query change. The maintainer prefers plain SQL migrations plus sqlx.
Change:
- Keep the goose migrations (internal/infrastructure/postgres/migrations) as the schema source.
- Move each query into the store method that uses it, as a SQL string executed with sqlx (Get/Select/NamedExec over structs with db tags), in place of the generated postgresdb calls.
- Delete postgresdb/, queries/, sqlc.yaml, the sqlc tool dependency, task db:generate and the db:check step in task check.
- Remove sqlc from CLAUDE.md's generated-files rule.
Do it store file by store file; behaviour must not change. The State Store SQL semantics (transition guards, idempotent dispatch, cancellation) are a listed test seam: add a test only where a converted query actually breaks.
### Acceptance criteria
No sqlc dependency, config or generated code remains; every store method runs its own SQL through sqlx; task check passes without db:check; the State Store starts against a migrated database and serves tasks.
---
_Imported from beads `archie-core-1rwj` · GitHub #1332 · type task · priority P2 · created 2026-10-03_
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Persistence uses sqlc: SQL in internal/infrastructure/postgres/queries/*.sql is compiled into ~6,200 lines of generated Go in postgresdb/, used by 15 files. That needs the sqlc tool in tools/go.mod, sqlc.yaml, task db:generate and the db:check gate step, and a regenerate step on every query change. The maintainer prefers plain SQL migrations plus sqlx.
Change:
Do it store file by store file; behaviour must not change. The State Store SQL semantics (transition guards, idempotent dispatch, cancellation) are a listed test seam: add a test only where a converted query actually breaks.
Acceptance criteria
No sqlc dependency, config or generated code remains; every store method runs its own SQL through sqlx; task check passes without db:check; the State Store starts against a migrated database and serves tasks.
Imported from beads
archie-core-1rwj· GitHub #1332 · type task · priority P2 · created 2026-10-03