SQLite key-value store wrapper
Find a file
Snider 620611fa27
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 2m37s
Merge remote-tracking branch 'github/dev'
2026-03-22 00:57:22 +00:00
.core chore: add .core/ build and release configs 2026-03-06 18:52:37 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:08 +00:00
.github/workflows ci: add Core ecosystem CI workflow with CodeRabbit auto-fix 2026-03-17 14:05:30 +00:00
docs docs: add human-friendly documentation 2026-03-11 13:02:40 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:49 +00:00
.gitignore chore: add .core/ and .idea/ to .gitignore 2026-03-15 10:17:50 +00:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:49 +00:00
bench_test.go bench: add supplemental benchmarks for GetAll scaling, parallel, TTL, Render 2026-02-20 04:53:52 +00:00
CLAUDE.md docs(claude.md): add Getting Started section with workspace and test setup 2026-03-17 07:09:41 +00:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:49 +00:00
coverage_test.go refactor(errors): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 21:48:59 +00:00
events.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:21:44 +00:00
events_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:17 +00:00
go.mod chore: sync dependencies for v0.1.9 2026-03-17 17:48:09 +00:00
go.sum chore: sync dependencies for v0.1.9 2026-03-17 17:48:09 +00:00
README.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:49 +00:00
scope.go refactor(errors): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 21:48:59 +00:00
scope_test.go fix: harden error handling and SQL wildcard injection 2026-03-09 08:20:38 +00:00
store.go refactor(errors): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 21:48:59 +00:00
store_test.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:21:44 +00:00

Go Reference License: EUPL-1.2 Go Version

go-store

Group-namespaced SQLite key-value store with TTL expiry, namespace isolation, quota enforcement, and a reactive event system. Backed by a pure-Go SQLite driver (no CGO), uses WAL mode for concurrent reads, and enforces a single connection to ensure pragma consistency. Supports scoped stores for multi-tenant use, Watch/Unwatch subscriptions, and OnChange callbacks — the designed integration point for go-ws real-time streaming.

Module: forge.lthn.ai/core/go-store Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "forge.lthn.ai/core/go-store"

st, err := store.New("/path/to/store.db")  // or store.New(":memory:")
defer st.Close()

st.Set("config", "theme", "dark")
st.SetWithTTL("session", "token", "abc123", 24*time.Hour)
val, err := st.Get("config", "theme")

// Watch for mutations
w := st.Watch("config", "*")
defer st.Unwatch(w)
for e := range w.Ch { fmt.Println(e.Type, e.Key) }

// Scoped store for tenant isolation
sc, _ := store.NewScoped(st, "tenant-42")
sc.Set("prefs", "locale", "en-GB")

Documentation

  • Architecture — storage layer, group/key model, TTL expiry, event system, namespace isolation
  • Development Guide — prerequisites, test patterns, benchmarks, adding methods
  • Project History — completed phases, known limitations, future considerations

Build & Test

go test ./...
go test -race ./...
go test -bench=. ./...
go build ./...

Licence

European Union Public Licence 1.2 — see LICENCE for details.