Logo
Explore Help
Sign In
go/sqlite
1
0
Fork 0
You've already forked sqlite
Code Issues Pull Requests Packages Releases 1 Activity
Files
v0.9.0
sqlite/compliance_test.go

9 lines
192 B
Go
Raw Permalink Normal View History

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/
2026-03-19 13:25:31 +00:00
package sqlite_test
import (
"code.nochebuena.dev/go/logz"
"code.nochebuena.dev/go/sqlite"
)
var _ sqlite.Component = sqlite.New(logz.New(logz.Options{}), sqlite.Config{Path: ":memory:"})
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 21ms Template: 1ms
English
English
Licenses API