What do you want to change?
sqlc query analysis requires a live PostgreSQL instance, but setting one up means either running a database separately. It also requires schema migration steps outside of sqlc.
Proposed change:
Add a testcontainers_image field to the database config block. When set, sqlc automatically starts a local PostgreSQL Docker container, applies schema migrations, and uses it for analysis — then tears it down when done.
database:
testcontainers_image: "postgres:18-alpine"
Mutually exclusive with uri and managed.
Pros:
- Real PostgreSQL analysis without any external DB setup
- Single config field replaces: start DB → apply migrations → pass URI
Scope:
- New testcontainers_image config field (v1 + v2 schemas)
- Validation: mutual exclusion with uri and managed
- PostgreSQL only (initial support)
- Container lifecycle managed by sqlc (start on first query, teardown on close)
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Go
What do you want to change?
sqlc query analysis requires a live PostgreSQL instance, but setting one up means either running a database separately. It also requires schema migration steps outside of sqlc.
Proposed change:
Add a testcontainers_image field to the database config block. When set, sqlc automatically starts a local PostgreSQL Docker container, applies schema migrations, and uses it for analysis — then tears it down when done.
Mutually exclusive with uri and managed.
Pros:
Scope:
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Go