Merge pull request '[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d...' (#71) from agent/read---spec-code-core-go-store-rfc-md-fu into dev
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

This commit is contained in:
Virgil 2026-04-03 07:44:43 +00:00
commit 6bd2197dfe
2 changed files with 11 additions and 8 deletions

12
doc.go
View file

@ -5,12 +5,6 @@
// Usage example:
//
// func main() {
// storeInstance, err := store.New(":memory:")
// if err != nil {
// return
// }
// defer storeInstance.Close()
//
// configuredStore, err := store.NewConfigured(store.StoreConfig{
// DatabasePath: ":memory:",
// Journal: store.JournalConfiguration{
@ -25,6 +19,12 @@
// }
// defer configuredStore.Close()
//
// storeInstance, err := store.New(":memory:")
// if err != nil {
// return
// }
// defer storeInstance.Close()
//
// if err := storeInstance.Set("config", "colour", "blue"); err != nil {
// return
// }

View file

@ -7,7 +7,7 @@ description: Group-namespaced SQLite key-value store with TTL expiry, namespace
`go-store` is a group-namespaced key-value store backed by SQLite. It provides persistent or in-memory storage with optional TTL expiry, namespace isolation for multi-tenant use, quota enforcement, and a reactive event system for observing mutations.
For declarative setup, `store.NewConfigured(store.StoreConfig{...})` takes a single config struct instead of functional options.
For declarative setup, `store.NewConfigured(store.StoreConfig{...})` takes a single config struct instead of functional options. Prefer this when the configuration is already known; use `store.New(path, ...)` when you are only varying the database path.
The package has a single runtime dependency -- a pure-Go SQLite driver (`modernc.org/sqlite`). No CGO is required. It compiles and runs on all platforms that Go supports.
@ -29,7 +29,10 @@ import (
func main() {
// Open /tmp/app.db for persistence, or use ":memory:" for ephemeral data.
storeInstance, err := store.New("/tmp/app.db")
storeInstance, err := store.NewConfigured(store.StoreConfig{
DatabasePath: "/tmp/app.db",
PurgeInterval: 30 * time.Second,
})
if err != nil {
return
}