feat(sqlite): initial stable release v0.9.0
Pure-Go CGO-free SQLite client with launcher lifecycle, write-mutex serialisation, health check, unit-of-work via context injection, and structured error mapping. What's included: - Executor / Tx / Client / Component interfaces using database/sql native types - Tx.Commit() / Tx.Rollback() without ctx, matching the honest database/sql contract - New(logger, cfg) constructor; database opened in OnInit - Config struct with env-tag support; default Pragmas: WAL + 5s busy timeout + FK enforcement - PRAGMA foreign_keys = ON enforced explicitly in OnInit - writeMu sync.Mutex acquired by UnitOfWork.Do to serialise writes and prevent SQLITE_BUSY - UnitOfWork via context injection; GetExecutor(ctx) returns active Tx or *sql.DB - HandleError mapping SQLite extended error codes to xerrors codes (unique/primary-key → AlreadyExists, foreign-key → InvalidInput, ErrNoRows → NotFound) - health.Checkable at LevelCritical; pure-Go modernc.org/sqlite driver (CGO_ENABLED=0 compatible) Tested-via: todo-api POC integration Reviewed-against: docs/adr/
This commit is contained in:
8
doc.go
Normal file
8
doc.go
Normal file
@@ -0,0 +1,8 @@
|
||||
// Package sqlite provides a pure-Go SQLite client (via modernc.org/sqlite) with launcher
|
||||
// lifecycle and health check integration.
|
||||
//
|
||||
// All tests can use Config{Path: ":memory:"} for fully isolated, self-contained databases.
|
||||
//
|
||||
// WAL mode, foreign key enforcement, and a busy timeout are enabled by default via the
|
||||
// Pragmas config field.
|
||||
package sqlite
|
||||
Reference in New Issue
Block a user