v0.4.0
The module is reduced to the SQL infrastructure service over the sqlate library
(github.com/standards-lab/sqlate), which owns everything from the .sql file to the scanned
row. A composition root wraps the pool this module constructs with sqlate.Wrap and the engine's
dialect from sqlate/postgres, compiles its statements through sqlate/query, and migrates
through sqlate/migrate.
Changed
- Breaking: the
ast,operation,exec, andseedpackages are removed. Authored SQL
files oversqlate/queryreplace the statement vocabulary and the runners;sqlate/migrate
and a consumer's own seed statements replaceseed. - Breaking: the
Session,Tx, andDialecttypes,ExecTx, and theProviderconstant
are removed, with theDB.Dialect,DB.Begin,DB.QueryContext,DB.QueryRowContext, and
DB.ExecContextmethods. Thesqlatepackage owns the session and the dialect. - Breaking: the four constraint-class sentinels,
ConstraintError, andErrVersionMismatch
are removed. Thesqlatepackage owns the constraint classes andsqlate/querythe version
mismatch; thesqlate/postgresdialect classifies driver errors inside the session. - Breaking:
NewisNew(conn *sql.DB, cfg Config) *DB. It panics on an unfinalized
config or a nil pool, the wiring rule the package comment now states. - The
buildtask and the CI build step run each module withGOWORK=off, so a pin that no
longer builds fails rather than being masked by the committedgo.work.
Added
admin: the database admin service.Newtakes the pool's lifecycle object, thesqlate
session, a prebuiltmigrate.Migrator, and the pattern catalog;Optionscarries a
Seeder, aRegistryof compiled statements, a logger, and the seed switch.Register
declares the service at lifecycleStage1;Startverifies the history, applies a pending
set, verifies the seeder, and seeds when enabled.Verify,Status,Up,Down,Steps,
Force, andSeedare triggers over the library's functions;CatalogandStatements
read build-time state;Diagnosepings, reads the server's version through the dialect's
optionalVersionercapability, and reports the pool's counters.- The base module requires
github.com/standards-lab/sqlatev0.1.0, a standard-library-only
module.