Skip to content

Releases: sonirico/vago

testit v0.3.0 - per-backend submodules, and a working redpanda resource

Choose a tag to compare

@sonirico sonirico released this 10 Aug 22:12
340a97d

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/testit v0.3.0 - the backend-agnostic docker resource pool (Resource, Pool, DockerResourcesPool, RunSafe). Depends only on dockertest and go-snaps; lol is replaced by the minimal testit.Logger (lol.Logger satisfies it structurally). Breaking: retryFunc is now the exported RetryOp, and backend constructors moved out of this module.
  • github.com/sonirico/vago/testit/postgres v0.1.0 - resource, suite and SQL fixtures.
  • github.com/sonirico/vago/testit/clickhouse v0.1.0 - resource, suite, fixtures and the config.d asset.
  • github.com/sonirico/vago/testit/redis v0.1.0 - resource and suite.
  • github.com/sonirico/vago/testit/redpanda v0.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

Choose a tag to compare

@sonirico sonirico released this 07 Aug 15:07

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.

  • QueryTx never rolled back. The executor callback always returned
    nil, so a failing fn returned its error to the caller and committed
    anyway
    . Anyone relying on it for atomicity did not have it. The same bug
    ran Do's after-commit hooks when fn had failed.
  • ExecutorRWO.RW() returned an executor built on the read-only handler.
  • Migrations could apply nothing and report success. LaunchPostgresql
    and LaunchClickhouse matched action against a switch with no
    default, leaving err nil 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.
  • NewNoopRepoContext panicked on first use, handing back a querier
    built on a zero-value *sql.DB whose connector is nil.
  • BulkUpdate/BulkUpdateSQL took an unexported parameter type, so
    these exported functions could not be called from outside the package.
    They now take BulkUpdatableRanger, mirroring BulkableRanger.
  • 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.ErrIsNoRows now checks only sql.ErrNoRows. The pgx-aware
    version is postgres.ErrIsNoRows. Keeping the old one in core would have
    kept pgx in core, which was the whole point.
  • db.Logger replaces lol.Logger in NewExecutor,
    NewDatabaseSqlExecutor, NewRWOExecutor and the Bulk* functions. It
    is source-compatible: lol.Logger satisfies 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.

v0.12.0

Choose a tag to compare

@sonirico sonirico released this 04 Aug 18:56
55b1ead

What's Changed

  • BREAKING: streams: make streams context-aware by @sonirico in #2

Full Changelog: v0.11.4...v0.12.0

v0.11.4

Choose a tag to compare

@sonirico sonirico released this 28 Dec 21:05

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@sonirico sonirico released this 28 Dec 14:10

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@sonirico sonirico released this 28 Dec 14:09

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@sonirico sonirico released this 28 Dec 13:56

Full Changelog: v0.11.0...v0.11.1

v0.11.0

Choose a tag to compare

@sonirico sonirico released this 28 Dec 12:43

Full Changelog: v0.10.0...v0.11.0

v0.10.0

Choose a tag to compare

@sonirico sonirico released this 08 Dec 13:48

Full Changelog: v0.9.0...v0.10.0

v0.9.0

Choose a tag to compare

@sonirico sonirico released this 01 Sep 17:04
2d1d82c

What's Changed

New Contributors

Full Changelog: v0.8.2...v0.9.0