diff --git a/doc.go b/doc.go index a770623..b2d7cde 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // Package store provides SQLite-backed storage for grouped entries, TTL expiry, -// namespace isolation, quota enforcement, reactive change notifications, and -// workspace journalling. +// namespace isolation, quota enforcement, reactive change notifications, +// workspace journalling, and explicit orphan recovery. // // Usage example: // @@ -93,6 +93,12 @@ // return // } // +// orphans := storeInstance.RecoverOrphans(".core/state") +// for _, orphanWorkspace := range orphans { +// fmt.Println(orphanWorkspace.Aggregate()) +// orphanWorkspace.Discard() +// } +// // journalResult := storeInstance.QueryJournal(`from(bucket: "events") |> range(start: -24h)`) // if !journalResult.OK { // return diff --git a/workspace.go b/workspace.go index 8c0df1b..68fc335 100644 --- a/workspace.go +++ b/workspace.go @@ -109,8 +109,8 @@ func (storeInstance *Store) NewWorkspace(name string) (*Workspace, error) { }, nil } -// RecoverOrphans opens any leftover workspace files so callers can inspect and -// decide whether to commit or discard them. +// RecoverOrphans opens leftover workspace files in a state directory so +// callers can inspect them before calling Discard(). // Usage example: `orphans := storeInstance.RecoverOrphans(".core/state")` func (storeInstance *Store) RecoverOrphans(stateDirectory string) []*Workspace { if storeInstance == nil {