Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ The repository uses a Go workspace and [mise](https://mise.jdx.dev):

```
mise run check # build, vet, format, fix, tidy, test, and lint every module, then lint-context and lint-references; writes nothing
mise run currency # report requirements, Go, tools, actions, images, and Dockerfile source ARGs behind their latest
mise run upgrade # upgrade every module's go directive and requirements, and the tools, to their latest
mise run currency # report tools, Go, requirements, actions, images, and Dockerfile source ARGs behind their latest, except a held one; writes nothing
mise run upgrade # move every pin currency reports to its latest, except a held one: tools, then Go and requirements, actions, images, and Dockerfile source ARGs
mise run db:up # build and start the compose PostgreSQL and wait until it is healthy
mise run db:down # stop PostgreSQL, discarding its data
mise run integration # run the integration tier against the running stack
Expand All @@ -75,8 +75,11 @@ mise run acceptance # db:up, integration, then db:down whatever the result; pr
`GO_DATABASE_DSN` in `mise.toml` follows it. The service builds from
`compose/postgres/Dockerfile`, a copy of sqlate's canonical PostgreSQL image: its `FROM` line is
the one image pin, `ARG PGVECTOR_VERSION` the extension's, and `mise run currency` reports either
when it trails its latest. The stack is a test-only harness that keeps its data on tmpfs, so every
`db:up` starts empty.
when it trails its latest; `mise run upgrade` moves it. The two tasks run `scripts/currency.sh`'s
`report` and `upgrade` modes, which run the same scans, so `upgrade` moves exactly what `report`
lists. A pin named in `mise.toml`'s `HOLDS` list, one
`<item> <pin>: <reason>` line each, is reported as held and never moved. The stack is a test-only
harness that keeps its data on tmpfs, so every `db:up` starts empty.

The `postgres/pgvector` module's integration tier sits behind the `integration` build tag and
runs against the stack: `admin.Start` activating a declared `vector` extension, a `vector`
Expand Down
1 change: 1 addition & 0 deletions STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The judgement calls the standards-reviewer applies to go-database, beyond what `
- `architecture/standards/go-elemental/principles/tests-and-docs.md`: the doc.go inventory of `database`, `admin`, `sweep`, `postgres` and `pgvector`, and the unit tier over sqlate's `sqltest`, the `database` tests' stub driver and the `postgres` tests' in-test `pgproto3` server; and `postgres/pgvector`'s integration tier, behind the `integration` tag, over sqlate's `postgres/pgtest` against the compose stack, run locally by `mise run acceptance`.
- `architecture/standards/go-elemental/principles/topology-and-naming.md`: the base module with `database`, `admin` and `sweep`, the `postgres` provider sub-module and its tags, and the `postgres/pgvector` sub-module and its tags.
- `architecture/standards/go-elemental/principles/release-and-ci.md`: the check, currency and upgrade tasks over `GO_MODULES`, which matches `go.work`'s use-list, the compose stack of `compose.yml` and `compose/postgres`, a test-only harness on tmpfs, and a changelog per module, `CHANGELOG.md`, `postgres/CHANGELOG.md` and `postgres/pgvector/CHANGELOG.md`.
- `architecture/standards/go-elemental/principles/database-extensions.md`: `admin`'s extension status and readiness, the `postgres/pgvector` sub-module, and the compose Dockerfile.
- `architecture/standards/go-elemental/principles/lifecycle-and-context.md`: `DB`'s `Start`, `Shutdown` and `Ready`, and `admin.Service`'s `Start` and `Ready`; the constructors' panics on an unfinalized `Config` or a missing pool, and `postgres.New`'s error on a reserved option.
- `architecture/standards/go-elemental/principles/baseline-standards.md`: `Config`'s pool-size and timeout defaults, and `admin`, which takes every migration set, seed set, catalog and registry from its consumer.
- `architecture/standards/go-elemental/principles/utc-times.md`: `postgres.New`'s connections, which scan `timestamptz` in UTC.
Expand Down
23 changes: 6 additions & 17 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jq = "1.8.2"
[env]
GO_MODULES = ". postgres postgres/pgvector"
GO_DATABASE_DSN = "postgres://app:app@127.0.0.1:{{ get_env(name='POSTGRES_PORT', default='5438') }}/app?sslmode=disable"
HOLDS = '''
'''

[tasks.check]
description = "Build, vet, format, fix, tidy, test, and lint every module, vetting, fixing, and linting the integration tier with its tag but running only the unit tier, then run lint-context and lint-references; writes nothing"
Expand Down Expand Up @@ -44,25 +46,12 @@ exit "$fail"
'''

[tasks.currency]
description = "Report every requirement, Go version, tool, action pin, image tag, and Dockerfile source ARG behind its latest; writes nothing"
run = "scripts/currency.sh"
description = "Report every mise tool, Go version, requirement, action pin, image tag, and Dockerfile source ARG behind its latest, a held one with its reason; writes nothing"
run = "scripts/currency.sh report"

[tasks.upgrade]
description = "Upgrade every module's go directive to the current Go minor, with no toolchain line, and its direct requirements and the local mise tools to their latest, rewriting go.mod and mise.toml"
run = '''
set -eu
export GOWORK=off
go_minor=$(mise latest go | cut -d. -f1,2)
for mod in $GO_MODULES; do
cd "$MISE_PROJECT_ROOT/$mod"
go mod edit -go="$go_minor" -toolchain=none
direct=$(go mod edit -json | jq -r '.Require[]? | select(.Indirect | not) | .Path')
[ -z "$direct" ] || go get $(printf '%s@latest ' $direct)
go mod tidy
done
cd "$MISE_PROJECT_ROOT"
mise upgrade --bump --local
'''
description = "Bump the mise tools, then each module's go directive (to the current Go minor, with no toolchain line) and direct requirements, with a tidy, then the action pins, image tags, Dockerfile FROM tags, and Dockerfile source ARGs, to their latest, but a held one; rewrites mise.toml, go.mod, go.sum, the workflows, and the compose files"
run = "scripts/currency.sh upgrade"

[tasks.build]
description = "Build every module in GO_MODULES standalone with GOWORK=off, resolving its pins as a consumer does"
Expand Down
6 changes: 6 additions & 0 deletions postgres/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ changelog covers this sub-module only; the base module keeps its own.

## [Unreleased]

### Changed

- The `go-database` requirement is v0.13.0, which requires `sqlate` v0.8.0 and adds
`admin.Status.Extensions`, readiness that follows each declared extension, and the
`ErrConflict` mapping of the extension errors. The provider's own API is unchanged.

## [v0.7.0] - 2026-11-11

### Changed
Expand Down
4 changes: 2 additions & 2 deletions postgres/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.27

require (
github.com/jackc/pgx/v5 v5.13.0
github.com/standards-lab/go-database v0.12.0
github.com/standards-lab/go-database v0.13.0
)

require (
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.3 // indirect
github.com/standards-lab/go-core v0.12.0 // indirect
github.com/standards-lab/sqlate v0.7.0 // indirect
github.com/standards-lab/sqlate v0.8.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/text v0.41.0 // indirect
)
8 changes: 4 additions & 4 deletions postgres/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/standards-lab/go-core v0.12.0 h1:sqrzK6QSppEYpwvVAyiWgzNuOsjfK0Kwe86GPuZpHsU=
github.com/standards-lab/go-core v0.12.0/go.mod h1:Yl/R+gM9YWczsePBCKXdPGh3FSdZ/5i8SapLIh3BDHU=
github.com/standards-lab/go-database v0.12.0 h1:CWAVRmH+GiX5RxDEOknrZ5Dawz5FiYADxb11Iv9B0BE=
github.com/standards-lab/go-database v0.12.0/go.mod h1:CC3FjKyT+6RKEqhSiqjS2tlLO+NRMrs/0UkWa4WM8FI=
github.com/standards-lab/sqlate v0.7.0 h1:GVb3OCDXwSS9RCxQ2BRIfV73zwBeJBhkvDLBJnTYd/U=
github.com/standards-lab/sqlate v0.7.0/go.mod h1:pikNmGf/z3x46SBWFXgt/xKIDZuquSgCoXy5OWBFFR4=
github.com/standards-lab/go-database v0.13.0 h1:xBiN+gZE2Q0x+S/N0DgaDNqT9feHxcu43BrHXpFfLnI=
github.com/standards-lab/go-database v0.13.0/go.mod h1:M4jca1wtAP4MUDAdLa+lgvBGAzyfc8A1EdpVaQssXfc=
github.com/standards-lab/sqlate v0.8.0 h1:G1uUIWmc2DxJz5YhtBvIlftfURnb3b2RKsYB59Wa03Y=
github.com/standards-lab/sqlate v0.8.0/go.mod h1:pikNmGf/z3x46SBWFXgt/xKIDZuquSgCoXy5OWBFFR4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand Down
Loading