[agent/codex:gpt-5.4-mini] Read docs/RFC-STORE.md fully. Find features described in the... #151

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-store-rfc-md-fu into dev 2026-04-04 14:23:40 +00:00
3 changed files with 4 additions and 9 deletions

View file

@ -37,10 +37,8 @@ type ScopedStore struct {
scopedWatchers map[uintptr]*scopedWatcherBinding
}
// ScopedStoreTransaction stages multiple namespace-prefixed writes in one
// SQLite transaction and only emits events after commit succeeds.
//
// Usage example: `err := scopedStore.Transaction(func(transaction *store.ScopedStoreTransaction) error { return transaction.Set("colour", "blue") })`
// Usage example: `if err := transaction.Delete("config", "colour"); err != nil { return err }`
type ScopedStoreTransaction struct {
scopedStore *ScopedStore
storeTransaction *StoreTransaction

View file

@ -67,7 +67,7 @@ func (storeConfig StoreConfig) Validate() error {
}
// Usage example: `config := storeInstance.JournalConfiguration(); fmt.Println(config.EndpointURL, config.Organisation, config.BucketName)`
// The values are copied into the store and used as journal metadata.
// Usage example: `store.New(":memory:", store.WithJournal("http://127.0.0.1:8086", "core", "events"))`
type JournalConfiguration struct {
// Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086"}`
EndpointURL string
@ -84,8 +84,7 @@ func (journalConfig JournalConfiguration) isConfigured() bool {
}
// Usage example: `storeInstance, err := store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}, PurgeInterval: 30 * time.Second})`
// Store keeps grouped key-value entries in SQLite and can also write completed
// work summaries to the journal table.
// Usage example: `value, err := storeInstance.Get("config", "colour")`
type Store struct {
sqliteDatabase *sql.DB
databasePath string

View file

@ -9,10 +9,8 @@ import (
core "dappco.re/go/core"
)
// StoreTransaction stages several Store operations in one SQLite transaction
// and delays watcher delivery until the commit is durable.
//
// Usage example: `err := storeInstance.Transaction(func(transaction *store.StoreTransaction) error { return transaction.Set("config", "colour", "blue") })`
// Usage example: `if err := transaction.Delete("config", "colour"); err != nil { return err }`
type StoreTransaction struct {
store *Store
transaction *sql.Tx