Repository navigation
Releases: sonirico/vago
Release list
testit v0.3.0 - per-backend submodules, and a working redpanda resource
The testit monolith is now a core module plus four per-backend submodules, mirroring the db/ v0.2.0 split: importing one backend no longer drags every other backend's driver.
github.com/sonirico/vago/testitv0.3.0 - the backend-agnostic docker resource pool (Resource, Pool, DockerResourcesPool, RunSafe). Depends only on dockertest and go-snaps; lol is replaced by the minimaltestit.Logger(lol.Logger satisfies it structurally). Breaking:retryFuncis now the exportedRetryOp, and backend constructors moved out of this module.github.com/sonirico/vago/testit/postgresv0.1.0 - resource, suite and SQL fixtures.github.com/sonirico/vago/testit/clickhousev0.1.0 - resource, suite, fixtures and the config.d asset.github.com/sonirico/vago/testit/redisv0.1.0 - resource and suite.github.com/sonirico/vago/testit/redpandav0.1.0 - rewritten and actually usable: correct --kafka-addr flags (the old --Redpanda-addr spelling never started a broker), injectable image via WithImage, WithClusterConfig/SetClusterConfig applying rpk cluster config through resource.Exec, port reservation via net.Listen instead of deprecated rand.Seed, and a real, un-skipped produce/consume smoke test.
PR: #3
db v0.2.0 — per-backend submodules, and four correctness fixes
db compiled ClickHouse, MongoDB, Redis and the Elastic APM stack into every
consumer that only wanted Postgres. It no longer does.
Verified from a module outside this workspace: importing db + db/postgres
now pulls zero mongo, clickhouse or redis packages.
New modules
db/postgres · db/clickhouse · db/mongo · db/redis — all at v0.1.0.
Core db keeps the backend-agnostic contract (Querier, Handler, Tx,
the Executor family, Context, the bulk SQL builders, In, OrderBy,
NullJSON*) and has no driver dependency at all.
Correctness fixes
Each was verified red against the original code before the fix, not merely
green after it.
QueryTxnever rolled back. The executor callback always returned
nil, so a failingfnreturned its error to the caller and committed
anyway. Anyone relying on it for atomicity did not have it. The same bug
ranDo's after-commit hooks whenfnhad failed.ExecutorRWO.RW()returned an executor built on the read-only handler.- Migrations could apply nothing and report success.
LaunchPostgresql
andLaunchClickhousematchedactionagainst aswitchwith no
default, leavingerrnil from the preceding call. Any action that was
not exactly"up"or"down"— a typo, a capital, an empty string —
applied zero migrations and returned no error, so a deployment would run
against a schema that was never touched. NewNoopRepoContextpanicked on first use, handing back a querier
built on a zero-value*sql.DBwhose connector is nil.BulkUpdate/BulkUpdateSQLtook an unexported parameter type, so
these exported functions could not be called from outside the package.
They now takeBulkUpdatableRanger, mirroringBulkableRanger.- ClickHouse HTTP responses leaked their body on every non-expected status.
Breaking changes
- Import paths.
OpenPgx*,OpenPg*,OpenPostgres,NewExecutorPgx,
NewRWOExecutorPgx,LaunchPostgresql→db/postgres.OpenCH,
OpenClickhouse,NewClickHouseHttp,LaunchClickhouse→
db/clickhouse.OpenMongo*,MongoParse*→db/mongo.OpenRedis,
NewApmRedisHook,RedisConfig,RedisTLSConfig→db/redis.
Symbol names are unchanged. db.ErrIsNoRowsnow checks onlysql.ErrNoRows. The pgx-aware
version ispostgres.ErrIsNoRows. Keeping the old one in core would have
kept pgx in core, which was the whole point.db.Loggerreplaceslol.LoggerinNewExecutor,
NewDatabaseSqlExecutor,NewRWOExecutorand theBulk*functions. It
is source-compatible:lol.Loggersatisfies it structurally with no
adapter, asserted at compile time rather than in prose.
One disclosed regression
db.Logger deliberately omits WithField/WithTrace. Go requires exact
signature identity for interface satisfaction, so a self-referential
WithField(...) db.Logger could never be satisfied by lol.Logger's
WithField(...) lol.Logger — verified empirically, not assumed. Keeping
them would have required an adapter importing both, which is the coupling
this release exists to remove.
The cost is two log lines losing a tag: the rollback error no longer carries
WithTrace(ctx), and the read/write executors no longer tag themselves with
mode. Callers wanting the latter can pass an already-tagged logger; the
former genuinely needs the per-call context and would need an adapter
package to restore.