type
Store
A PostgreSQL implementation of Ridu’s document, snapshot, auth, preference, task, job, lock, upload-reference, and migration store contracts.
Implemented capabilities
| Property | Type | Description |
|---|---|---|
store.Store | document transactions | Begins atomic read-write operation transactions. |
store.SnapshotStore | stable snapshots | Begins stable read snapshots for upload reconciliation and other cross-page scans. |
store.HealthStore | connectivity | Checks PostgreSQL connectivity through Ping. |
store.ReadinessStore | runtime readiness | Checks connectivity, the completed ledger head manifest, and incomplete phased work. |
store.MigrationReadinessStore | exact executable history | Checks the complete ordered ledger against the fingerprint embedded in the release binary. |
store.PreferenceStore | preferences | Persists per-user admin and application settings. |
store.DocumentLockStore | document locks | Acquires, renews, takes over, and releases authoring leases. |
store.AuthStore | authentication | Persists password state, sessions, tokens, API keys, and auth rate limits. |
store.AuthMaintenanceStore | auth maintenance | Prunes expired sessions and API keys in bounded batches. |
store.AuthUnlockStore | account unlocks | Clears authorized persisted account lockout state. |
store.TaskStore | durable tasks | Enqueues, leases, completes, retries, cancels, inspects, and prunes durable work. |
store.UploadObjectLocker | upload coordination | Serializes upload object creation, adoption, and destructive deletion across processes. |
How it works
Use the application and Local API for content operations. These capability interfaces are primarily useful to framework/runtime integrations. Transactions returned by Begin implement store.Transaction, AuthTransaction, AuthBootstrapTransaction, AuthUnlockTransaction, VersionTransaction, UploadReferenceTransaction, and transaction-level UploadObjectLocker.
Full signature
type Store struct {
// contains filtered or unexported fields
}Methods
Store.Close()Close both the document pool and dedicated upload-lock pool.
Store.Ping()Check database connectivity.
Store.Ready()Prove connectivity and completed migration state for the running manifest.
Store.ReadyWithMigrationHistory()Prove ordinary readiness and exact agreement with executable migration history.
Store.Begin()Begin a read-write document transaction.
Store.BeginSnapshot()Begin a stable read snapshot.
Store.VerifySchema()Verify without changing anything that the physical schema exactly matches a manifest.
Store.ApplyArtifacts()Validate all immutable history, take an advisory lock, and apply each pending artifact.
Store.ApplyArtifactsWithOptions()Apply artifacts with explicit maintenance, timeout, and stop-boundary controls.
Store.ArtifactStatus()Report applied/pending artifacts and durable phased progress.
Store.ArtifactPlan()Return immutable execution topology and checkpoints without applying work.
Store.AcquireDocumentLock()Public method Store.AcquireDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.AllowAuthAttempt()Public method Store.AllowAuthAttempt from github.com/riducms/ridu/adapters/postgres.
Store.CancelTask()Public method Store.CancelTask from github.com/riducms/ridu/adapters/postgres.
Store.ChangePasswordHash()Public method Store.ChangePasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.ClaimTasks()Public method Store.ClaimTasks from github.com/riducms/ridu/adapters/postgres.
Store.CompleteTask()Public method Store.CompleteTask from github.com/riducms/ridu/adapters/postgres.
Store.CreateAPIKey()Public method Store.CreateAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.CreateAuthToken()Public method Store.CreateAuthToken from github.com/riducms/ridu/adapters/postgres.
Store.CreateSession()Public method Store.CreateSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteAPIKey()Public method Store.DeleteAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.DeletePreference()Public method Store.DeletePreference from github.com/riducms/ridu/adapters/postgres.
Store.DeletePreferences()Public method Store.DeletePreferences from github.com/riducms/ridu/adapters/postgres.
Store.DeleteSession()Public method Store.DeleteSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteUserSession()Public method Store.DeleteUserSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteUserSessions()Public method Store.DeleteUserSessions from github.com/riducms/ridu/adapters/postgres.
Store.DismissTaskForTarget()Public method Store.DismissTaskForTarget from github.com/riducms/ridu/adapters/postgres.
Store.EnqueueTask()Public method Store.EnqueueTask from github.com/riducms/ridu/adapters/postgres.
Store.FailTask()Public method Store.FailTask from github.com/riducms/ridu/adapters/postgres.
Store.FindAPIKey()Public method Store.FindAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.FindAuthCredential()Public method Store.FindAuthCredential from github.com/riducms/ridu/adapters/postgres.
Store.FindDocumentLock()Public method Store.FindDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.FindSession()Public method Store.FindSession from github.com/riducms/ridu/adapters/postgres.
Store.FindTask()Public method Store.FindTask from github.com/riducms/ridu/adapters/postgres.
Store.ForceUnlock()Public method Store.ForceUnlock from github.com/riducms/ridu/adapters/postgres.
Store.GetPreference()Public method Store.GetPreference from github.com/riducms/ridu/adapters/postgres.
Store.HeartbeatTask()Public method Store.HeartbeatTask from github.com/riducms/ridu/adapters/postgres.
Store.ListAPIKeys()Public method Store.ListAPIKeys from github.com/riducms/ridu/adapters/postgres.
Store.ListSessions()Public method Store.ListSessions from github.com/riducms/ridu/adapters/postgres.
Store.ListTasks()Public method Store.ListTasks from github.com/riducms/ridu/adapters/postgres.
Store.LockUploadObjects()LockUploadObjects uses session advisory locks so object-store deletion and migration-owned adoption of an existing key cannot pass each other between database transactions or application processes.
Store.PruneExpiredAuth()PruneExpiredAuth removes one bounded batch from each expiring durable credential family. The candidate ordering matches the lifecycle indexes; row locks let every process run the same maintenance cycle without duplicate work or an application-wide coordinator.
Store.PruneTasks()Public method Store.PruneTasks from github.com/riducms/ridu/adapters/postgres.
Store.RecordFailedLogin()Public method Store.RecordFailedLogin from github.com/riducms/ridu/adapters/postgres.
Store.ReleaseDocumentLock()Public method Store.ReleaseDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.ReleaseTask()Public method Store.ReleaseTask from github.com/riducms/ridu/adapters/postgres.
Store.ResetLoginAttempts()Public method Store.ResetLoginAttempts from github.com/riducms/ridu/adapters/postgres.
Store.ResetPasswordWithToken()Public method Store.ResetPasswordWithToken from github.com/riducms/ridu/adapters/postgres.
Store.RotateSession()Public method Store.RotateSession from github.com/riducms/ridu/adapters/postgres.
Store.SetPasswordHash()Public method Store.SetPasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.SetPreference()Public method Store.SetPreference from github.com/riducms/ridu/adapters/postgres.
Store.TouchAPIKey()Public method Store.TouchAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.UpgradePasswordHash()Public method Store.UpgradePasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.VerifyEmailWithToken()Public method Store.VerifyEmailWithToken from github.com/riducms/ridu/adapters/postgres.
Store.AdoptArtifacts()AdoptArtifacts records pending migrations as applied, without running them, through the newest one whose schema the database already has, such as a database ridu dev synchronized. See ridu migrate baseline.
Store.ClearDevelopmentFieldKinds()ClearDevelopmentFieldKinds atomically clears precisely the confirmed field values in current documents and every snapshot. It refuses immutable history and changes physical scalar column types only after their values are cleared.
Store.DevelopmentManifest()DevelopmentManifest returns the database-owned last synchronized schema. A missing record is fresh only when no application tables or migration history exist; otherwise the schema is unknown and an error is returned.
Store.FindSessionByID()Public method Store.FindSessionByID from github.com/riducms/ridu/adapters/postgres.
Store.HasMigrationHistory()HasMigrationHistory reports applied or incomplete immutable history. A development recovery must use the migration runner once that history exists.
Store.ReplaceBaseline()ReplaceBaseline replaces a verified development ledger without running migrations or changing content. The database must already have the schema of the last replacement artifact it can record; later artifacts with data or semantic steps stay pending for ApplyArtifacts.
Store.ReviewDevelopmentFieldKinds()ReviewDevelopmentFieldKinds counts stored current values and retained snapshots without interpreting them under the candidate field kinds.
Store.ReviewDevelopmentVersions()ReviewDevelopmentVersions counts the documents, trashed ones included, that each resource starting to keep versions between before and after already stores in this database. A resource without a table stores none. It changes nothing.
Store.SyncDevelopmentSchema()SyncDevelopmentSchema plans, applies, verifies and records safe development changes in one transaction under the migration lock. Production artifacts retain their separate concurrent-index phases.