Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
226e10630b
|
||
|
|
585c76a525
|
@@ -1,6 +1,6 @@
|
|||||||
# einherjar/db-sqlite
|
# einherjar/db-sqlite
|
||||||
|
|
||||||
[](https://code.nochebuena.dev/einherjar/db-sqlite)
|
[](https://code.nochebuena.dev/einherjar/db-sqlite)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://go.dev)
|
[](https://go.dev)
|
||||||
[]()
|
[]()
|
||||||
@@ -19,8 +19,9 @@
|
|||||||
import dbsqlite "code.nochebuena.dev/einherjar/db-sqlite"
|
import dbsqlite "code.nochebuena.dev/einherjar/db-sqlite"
|
||||||
|
|
||||||
db := dbsqlite.New(logger, dbsqlite.DefaultConfig())
|
db := dbsqlite.New(logger, dbsqlite.DefaultConfig())
|
||||||
launcher.Append(db) // OnInit opens database; OnStop closes it
|
lc.Append(db) // OnInit opens database; OnStop closes it
|
||||||
health.Register(db) // BucketExists-style check; LevelDegraded
|
// db is observability.Checkable (LevelDegraded):
|
||||||
|
srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Querying
|
### Querying
|
||||||
|
|||||||
@@ -15,8 +15,12 @@
|
|||||||
// # Lifecycle Registration
|
// # Lifecycle Registration
|
||||||
//
|
//
|
||||||
// db := sqlite.New(logger, cfg)
|
// db := sqlite.New(logger, cfg)
|
||||||
// launcher.Register(db)
|
// lc.Append(db) // lifecycle: OnInit → OnStart → OnStop
|
||||||
// health.Register(db)
|
//
|
||||||
|
// db satisfies [observability.Checkable], so it can back a health endpoint via
|
||||||
|
// web/health.NewHandler:
|
||||||
|
//
|
||||||
|
// srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
|
||||||
//
|
//
|
||||||
// # Querying
|
// # Querying
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ module code.nochebuena.dev/einherjar/db-sqlite
|
|||||||
go 1.26
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.nochebuena.dev/einherjar/contracts v1.1.0
|
code.nochebuena.dev/einherjar/contracts v1.1.1
|
||||||
code.nochebuena.dev/einherjar/core v1.1.0
|
code.nochebuena.dev/einherjar/core v1.1.1
|
||||||
modernc.org/sqlite v1.37.1
|
modernc.org/sqlite v1.37.1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
code.nochebuena.dev/einherjar/contracts v1.1.0 h1:GsGr6reyrd9qCc7D8CqbT1LWPTeeK9lT4r4EdsNA5Ro=
|
code.nochebuena.dev/einherjar/contracts v1.1.1 h1:MRQUR8Q1D4wIOUIz11vpAdsapWqFTMwr0/VRvWbGO3s=
|
||||||
code.nochebuena.dev/einherjar/contracts v1.1.0/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI=
|
code.nochebuena.dev/einherjar/contracts v1.1.1/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI=
|
||||||
code.nochebuena.dev/einherjar/core v1.1.0 h1:zxj9bFPthEEFRnvWV/vgNZqWa2y/kAo3p5pODWablyk=
|
code.nochebuena.dev/einherjar/core v1.1.1 h1:W6V/Peh1ffWjqZnBuBQLn4UGM+bgvWt9MQuktTEfDFw=
|
||||||
code.nochebuena.dev/einherjar/core v1.1.0/go.mod h1:Ot2JbjsnZ33Ed5C9Ev1kSn2PW+F4dLz/LRwIUh+fYt0=
|
code.nochebuena.dev/einherjar/core v1.1.1/go.mod h1:ninuZlnO178zC4rOdt5vjGojnlOpygP8cDorrecAeTY=
|
||||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
|
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
|
||||||
|
|||||||
Reference in New Issue
Block a user