From 08e896ad4dfa47254527d4f970472ba285ce9f11 Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 17:27:10 +0000 Subject: [PATCH] docs(store): clarify journal metadata Align the RFC text and store comments with the SQLite-backed journal implementation. Co-Authored-By: Virgil --- docs/RFC-STORE.md | 8 ++++---- store.go | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/RFC-STORE.md b/docs/RFC-STORE.md index 171fbd2..40ff220 100644 --- a/docs/RFC-STORE.md +++ b/docs/RFC-STORE.md @@ -43,9 +43,9 @@ SQLite-backed key-value store with TTL, namespace isolation, reactive events, an // Store is the SQLite KV store with optional SQLite journal backing. type Store struct { db *sql.DB // SQLite connection (single, WAL mode) - journal influxdb2.Client // InfluxDB client (nil if no journal configured) - bucket string // InfluxDB bucket name - org string // InfluxDB org + journal JournalConfiguration // SQLite journal metadata (nil-equivalent when zero-valued) + bucket string // Journal bucket name + org string // Journal organisation mu sync.RWMutex watchers map[string][]chan Event } @@ -62,7 +62,7 @@ type Event struct { // New creates a store. Journal is optional — pass WithJournal() to enable. // // st, _ := store.New(":memory:") // SQLite only -// st, _ := store.New("/path/to/db", store.WithJournal( // SQLite + InfluxDB +// st, _ := store.New("/path/to/db", store.WithJournal( // "http://localhost:8086", "core-org", "core-bucket", // )) func New(path string, opts ...StoreOption) (*Store, error) { } diff --git a/store.go b/store.go index 85a0564..a21f73f 100644 --- a/store.go +++ b/store.go @@ -67,6 +67,10 @@ func (storeConfig StoreConfig) Validate() error { } // Usage example: `config := storeInstance.JournalConfiguration(); fmt.Println(config.EndpointURL, config.Organisation, config.BucketName)` +// JournalConfiguration stores the SQLite journal metadata used by +// CommitToJournal and QueryJournal. The field names stay aligned with the +// agent-facing RFC vocabulary even though the implementation is local to this +// package. // Usage example: `store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})` type JournalConfiguration struct { // Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086"}`