Documentation
¶
Overview ¶
Package sqlite implements haistack-sqlite, the embedded offline database layer for haistack local deployments.
haistack-sqlite is the SQLite-backed implementation of pkg/store contracts for device, tablet, workstation, and lightweight edge nodes. It owns schema, migrations, and the atomic local write path. This is not bytefhir-sqlite; it is the haistack runtime's embedded persistence adapter at github.com/degoke/haistack/pkg/sqlite.
Design principles ¶
Single-transaction local writes:
- A local write must update current resource state, immutable history, sync outbox, and typed search index rows in one SQLite transaction so persistence and sync state cannot drift.
- ApplyLocalWrite and Session implement this guarantee for callers.
- Version assignment and search extraction stay outside this package; SQLite persists caller-supplied version IDs and prepared SearchIndexEntry values.
Canonical JSON:
- types.ResourceEnvelope.JSON is the source of truth for resource content.
- Stores persist JSON blobs plus metadata columns (version_id, last_updated, hash).
- Optional proto blob columns are deferred to a future migration.
Pure Go driver:
- database/sql with modernc.org/sqlite for cross-platform embedded use without CGO.
- Default pragmas: foreign_keys=ON, journal_mode=WAL, configurable busy_timeout.
Opening a database ¶
db, err := sqlite.OpenAndMigrate(ctx, "/path/to/haistack.db")
if err != nil { … }
defer db.Close()
Or open and migrate separately:
db, err := sqlite.Open("/path/to/haistack.db")
if err != nil { … }
defer db.Close()
if err := db.Migrate(ctx); err != nil { … }
Reopening an existing file uses the same pattern: a fresh Open (or OpenAndMigrate) call, then reconstruct in-memory services and snapshots. Migrate is idempotent. Close leaves the database file on disk; remove the parent directory with os.RemoveAll when cleaning up temporary test databases.
Open accepts functional options such as WithBusyTimeout. Use path ":memory:" for ephemeral in-memory databases (common in tests).
Implemented contracts (MVP-complete) ¶
These types satisfy pkg/store interfaces and are fully wired for local MVP use:
- ResourceStore → store.ResourceStore — current-state CRUD
- HistoryStore → store.HistoryStore — immutable version history and tombstones
- SearchStore → store.SearchStore — typed search_token/string/date/number/reference tables
- OutboxStore → store.EventStore — append-only sync_outbox with monotonic sequence
- CursorStore → store.CursorStore — named sync_cursor checkpoints
- Session → store.WriteSession — transaction-scoped stores for atomic writes
- DB → store.WriteSessionProvider via BeginWrite
Scaffold contracts (schema + store; upstream workflow deferred) ¶
These adapters persist data correctly but intentionally omit higher-level orchestration:
- InboxStore → store.InboxStore — sync_inbox_applied idempotency for pull/apply.
- ConflictStore → store.ConflictStore — sync_conflict append/list/resolve. Conflict detection and reconciliation policy live in pkg/core and sync layers.
- BinaryStore → store.BinaryStore — small inline binary_object payloads. Large blob offload and deduplication are out of scope for embedded SQLite.
- ModuleStore → store.ModuleStore — module_registry metadata. Code loading and activation policy live elsewhere.
- JobStore → store.JobStore — background_job enqueue/claim/update. Scheduling and worker loops live in pkg/jobs.
- AuditStore → store.AuditStore — append-only audit_log. Event shaping and emit helpers live in pkg/audit.
Out of scope (not in haistack-sqlite MVP) ¶
Use pkg/postgres or future adapters for:
- optional proto column on resource
- encrypted SQLite (SQLCipher / platform keystore)
- hot backup and restore
- vacuum, compaction, and maintenance jobs
- multiple database profiles per device
- store.BlobStore with external blob references
- store.IDRegistryStore
- analytics store
- materialized projection store
Atomic local write path ¶
High-level helper:
result, err := db.ApplyLocalWrite(ctx, sqlite.LocalWrite{
Resource: envelope,
Action: store.VersionActionCreate,
SearchEntries: []store.SearchIndexEntry{…},
Event: event,
Version: version,
})
Manual session (same transaction boundary):
session, err := db.BeginWrite(ctx) session.ResourceStore().Create(ctx, envelope) session.HistoryStore().AppendVersion(ctx, version) session.EventStore().Append(ctx, event) session.SearchStore().Index(ctx, entry) session.Commit(ctx)
ApplyLocalWrite and Session cover create, update, and delete. Delete removes current resource state, appends a history tombstone, emits an outbox event, and clears search index rows for the resource. ApplyLocalWrite does not run validation or build search entries; callers supply prepared SearchIndexEntry values. Use BeginWrite/BeginSession directly when higher-level steps must roll back together with persistence.
Search index field keys ¶
SearchStore routes fields to typed tables using key prefixes:
- token.<name> → hai_search_token
- string.<name> → hai_search_string
- date.<name> → hai_search_date
- number.<name> → hai_search_number
- reference.<name> or ref.<name> → hai_search_reference
- uri.<name> → hai_search_string
Keys without a prefix (for example "family") default to hai_search_string. FHIR search parsing and token extraction remain in pkg/search; this package stores prepared entries.
Search limitations on SQLite:
- SearchStore implements store.SearchQueryExecutor (LookupMatch, FieldValues) only.
- It does not implement store.SearchAdvancedExecutor: no LookupReferences, LookupReferencing, or LookupFullText. Queries using _include, _revinclude, or full-text search return store.ErrUnsupportedFeature.
- Index skips composite.* and text.* field keys; composite and full-text parameters cannot be queried through the SQLite adapter.
QueryPrepared supports the "by-field" plan (args: key, value) matching pkg/store test doubles.
Schema and migrations ¶
Migrations are embedded numbered SQL files under migrations/ (for example 0001_init.sql). Migrate runs them idempotently and records applied versions in hai_schema_migrations.
Main tables:
- hai_resource — current canonical state keyed by (resource_type, id)
- hai_resource_history — immutable version log with delete tombstones
- hai_search_* — five typed index tables (no generic fallback)
- hai_sync_outbox — append-only local change events (AUTOINCREMENT sequence)
- hai_sync_inbox_applied — remote operation idempotency (scaffold)
- hai_sync_cursor — named consumer checkpoints
- hai_sync_conflict — conflict records (scaffold)
- hai_binary_object — inline binary metadata and payload (scaffold)
- hai_module_registry — local module registration metadata (scaffold)
Integration with other packages ¶
pkg/store — interface contracts; sqlite implements the embedded-local subset. pkg/types — ResourceEnvelope is the only FHIR container crossing store boundaries. pkg/postgres — tenant-scoped edge/cloud adapter with broader contract surface. pkg/core — orchestrates write pipelines and version policy on top of store interfaces. pkg/search — produces SearchIndexEntry values; does not implement SearchStore.
File layout ¶
- doc.go — package documentation (this file)
- db.go — DB, Open, Migrate, ApplyLocalWrite, store constructors
- options.go — Open options (WithBusyTimeout)
- migrate.go — embedded migration runner
- session.go — Session, BeginSession, atomic write pipeline
- resource_store.go — ResourceStore
- history_store.go — HistoryStore
- search_store.go — SearchStore
- outbox_store.go — OutboxStore (EventStore)
- inbox_store.go — InboxStore (scaffold)
- cursor_store.go — CursorStore
- conflict_store.go — ConflictStore (scaffold)
- binary_store.go — BinaryStore (scaffold)
- module_store.go — ModuleStore (scaffold)
- job_store.go — JobStore
- audit_store.go — AuditStore
- timeutil.go — RFC3339Nano timestamp helpers
- migrations/*.sql — embedded schema migrations
Testing ¶
sqlite_test.go contains integration tests against temporary and :memory: databases: migration idempotency, per-store CRUD, ApplyLocalWrite atomicity and rollback, delete tombstones, concurrent smoke tests, and compose-style lifecycle tests mirroring pkg/store/store_test.go.
Index ¶
- type AuditStore
- type AuthStore
- func (s *AuthStore) DeleteDevice(ctx context.Context, deviceID string) error
- func (s *AuthStore) DeletePolicy(ctx context.Context, name string) error
- func (s *AuthStore) DeletePrincipal(ctx context.Context, id string) error
- func (s *AuthStore) DeleteRole(ctx context.Context, name string) error
- func (s *AuthStore) DeleteTenantBinding(ctx context.Context, principalID string) error
- func (s *AuthStore) GetActivePolicy(ctx context.Context) (*store.AuthPolicyRecord, error)
- func (s *AuthStore) GetDevice(ctx context.Context, deviceID string) (*store.AuthDeviceRecord, error)
- func (s *AuthStore) GetPolicy(ctx context.Context, name string) (*store.AuthPolicyRecord, error)
- func (s *AuthStore) GetPrincipal(ctx context.Context, id string) (*store.AuthPrincipalRecord, error)
- func (s *AuthStore) GetRole(ctx context.Context, name string) (*store.AuthRoleRecord, error)
- func (s *AuthStore) GetTenantBinding(ctx context.Context, principalID string) (*store.AuthTenantBindingRecord, error)
- func (s *AuthStore) ListDevices(ctx context.Context) ([]store.AuthDeviceRecord, error)
- func (s *AuthStore) ListPolicies(ctx context.Context) ([]store.AuthPolicyRecord, error)
- func (s *AuthStore) ListPrincipals(ctx context.Context) ([]store.AuthPrincipalRecord, error)
- func (s *AuthStore) ListRoles(ctx context.Context) ([]store.AuthRoleRecord, error)
- func (s *AuthStore) ListTenantBindings(ctx context.Context) ([]store.AuthTenantBindingRecord, error)
- func (s *AuthStore) Snapshot(ctx context.Context) (*store.AuthSnapshot, error)
- func (s *AuthStore) UpsertDevice(ctx context.Context, device store.AuthDeviceRecord) error
- func (s *AuthStore) UpsertPolicy(ctx context.Context, policy store.AuthPolicyRecord) error
- func (s *AuthStore) UpsertPrincipal(ctx context.Context, principal store.AuthPrincipalRecord) error
- func (s *AuthStore) UpsertRole(ctx context.Context, role store.AuthRoleRecord) error
- func (s *AuthStore) UpsertTenantBinding(ctx context.Context, binding store.AuthTenantBindingRecord) error
- type BinaryStore
- type BlobMetadataStore
- func (s *BlobMetadataStore) CreateDownloadSession(ctx context.Context, session binary.DownloadSession) error
- func (s *BlobMetadataStore) CreateUploadSession(ctx context.Context, session binary.UploadSession) error
- func (s *BlobMetadataStore) DeleteBinaryLink(ctx context.Context, resourceID string) error
- func (s *BlobMetadataStore) DeleteDocumentLink(ctx context.Context, documentID string, contentIndex int) error
- func (s *BlobMetadataStore) DeleteDownloadSession(ctx context.Context, id string) error
- func (s *BlobMetadataStore) DeleteManifest(ctx context.Context, blobID string) error
- func (s *BlobMetadataStore) DeleteSyncStatus(ctx context.Context, blobID string) error
- func (s *BlobMetadataStore) DeleteUploadSession(ctx context.Context, id string) error
- func (s *BlobMetadataStore) GetBinaryLink(ctx context.Context, resourceID string) (*binary.BinaryLink, error)
- func (s *BlobMetadataStore) GetDocumentLink(ctx context.Context, documentID string, contentIndex int) (*binary.DocumentAttachmentLink, error)
- func (s *BlobMetadataStore) GetDownloadSession(ctx context.Context, id string) (*binary.DownloadSession, error)
- func (s *BlobMetadataStore) GetManifest(ctx context.Context, blobID string) (*binary.BlobManifest, error)
- func (s *BlobMetadataStore) GetManifestByHash(ctx context.Context, sha256 string) (*binary.BlobManifest, error)
- func (s *BlobMetadataStore) GetSyncStatus(ctx context.Context, blobID string) (binary.BlobSyncStatus, error)
- func (s *BlobMetadataStore) GetUploadSession(ctx context.Context, id string) (*binary.UploadSession, error)
- func (s *BlobMetadataStore) PutBinaryLink(ctx context.Context, link binary.BinaryLink) error
- func (s *BlobMetadataStore) PutDocumentLink(ctx context.Context, link binary.DocumentAttachmentLink) error
- func (s *BlobMetadataStore) PutManifest(ctx context.Context, manifest binary.BlobManifest) error
- func (s *BlobMetadataStore) PutSyncStatus(ctx context.Context, blobID string, status binary.BlobSyncStatus) error
- func (s *BlobMetadataStore) UpdateDownloadSession(ctx context.Context, session binary.DownloadSession) error
- func (s *BlobMetadataStore) UpdateUploadSession(ctx context.Context, session binary.UploadSession) error
- type ChunkBlobStore
- type ConflictStore
- type CursorStore
- type DB
- func (db *DB) ApplyLocalWrite(ctx context.Context, input LocalWrite) (*LocalWriteResult, error)
- func (db *DB) AuditStore() *AuditStore
- func (db *DB) AuthStore(tenantID string) *AuthStore
- func (db *DB) BeginSession(ctx context.Context) (*Session, error)
- func (db *DB) BeginWrite(ctx context.Context) (store.WriteSession, error)
- func (db *DB) BinaryStore() *BinaryStore
- func (db *DB) BlobMetadataStore() *BlobMetadataStore
- func (db *DB) ChunkBlobStore() *ChunkBlobStore
- func (db *DB) Close() error
- func (db *DB) ConflictStore() *ConflictStore
- func (db *DB) CursorStore() *CursorStore
- func (db *DB) DefinitionStore() *DefinitionStore
- func (db *DB) GlobalTerminologyStore() *TerminologyStore
- func (db *DB) HistoryStore() *HistoryStore
- func (db *DB) InboxStore() *InboxStore
- func (db *DB) JobStore() *JobStore
- func (db *DB) Migrate(ctx context.Context) error
- func (db *DB) ModuleStore() *ModuleStore
- func (db *DB) OutboxStore() *OutboxStore
- func (db *DB) PackageInstallStore() *PackageInstallStore
- func (db *DB) RegistryInstallStore() *RegistryInstallStore
- func (db *DB) ResourceStore() *ResourceStore
- func (db *DB) SQL() *sql.DB
- func (db *DB) SQLiteBlobStore() *SQLiteBlobStore
- func (db *DB) SearchStore() *SearchStore
- func (db *DB) SubscriptionDeliveryStore() *SubscriptionDeliveryStore
- func (db *DB) SubscriptionStore() *SubscriptionStore
- func (db *DB) TerminologyInstallStore(tenantID string) *TerminologyInstallStore
- func (db *DB) TerminologyStore() *TerminologyStore
- type DefinitionStore
- func (s *DefinitionStore) Delete(ctx context.Context, canonicalURL, version string) error
- func (s *DefinitionStore) Get(ctx context.Context, canonicalURL, version string) (*store.DefinitionResourceRecord, error)
- func (s *DefinitionStore) List(ctx context.Context, filter store.DefinitionFilter) ([]store.DefinitionResourceRecord, error)
- func (s *DefinitionStore) Upsert(ctx context.Context, record store.DefinitionResourceRecord, ...) error
- type HistoryStore
- func (s *HistoryStore) AppendVersion(ctx context.Context, version store.ResourceVersion) error
- func (s *HistoryStore) GetHistory(ctx context.Context, resourceType, id string) ([]store.ResourceVersion, error)
- func (s *HistoryStore) GetVersion(ctx context.Context, resourceType, id, versionID string) (store.ResourceVersion, error)
- type InboxStore
- func (s *InboxStore) AppliedAt(ctx context.Context, id string) (*time.Time, error)
- func (s *InboxStore) GetAckPayload(ctx context.Context, id string) ([]byte, bool, error)
- func (s *InboxStore) IsApplied(ctx context.Context, id string) (bool, error)
- func (s *InboxStore) MarkApplied(ctx context.Context, id string, appliedAt time.Time) error
- func (s *InboxStore) MarkAppliedWithPayload(ctx context.Context, id string, payload []byte, appliedAt time.Time) error
- type JobStore
- func (s *JobStore) ClaimNext(ctx context.Context, jobType string) (*store.JobRecord, error)
- func (s *JobStore) Delete(ctx context.Context, id string) error
- func (s *JobStore) Enqueue(ctx context.Context, job store.JobRecord) error
- func (s *JobStore) Get(ctx context.Context, id string) (*store.JobRecord, error)
- func (s *JobStore) Update(ctx context.Context, job store.JobRecord) error
- func (s *JobStore) UpdateIf(ctx context.Context, job store.JobRecord, expectedUpdatedAt time.Time) (bool, error)
- type LocalWrite
- type LocalWriteResult
- type ModuleStore
- func (s *ModuleStore) Get(ctx context.Context, name string) (*store.ModuleRecord, error)
- func (s *ModuleStore) List(ctx context.Context) ([]store.ModuleRecord, error)
- func (s *ModuleStore) Register(ctx context.Context, module store.ModuleRecord) error
- func (s *ModuleStore) Unregister(ctx context.Context, name string) error
- type Option
- type OutboxStore
- func (s *OutboxStore) Append(ctx context.Context, event store.ResourceEvent) (store.ResourceEvent, error)
- func (s *OutboxStore) LatestForResource(ctx context.Context, resourceType, id string) (*store.ResourceEvent, error)
- func (s *OutboxStore) ReadSince(ctx context.Context, afterSequence int64, limit int) ([]store.ResourceEvent, error)
- type PackageInstallStore
- type RegistryInstallStore
- func (s *RegistryInstallStore) Delete(ctx context.Context, filter store.RegistryInstallFilter) error
- func (s *RegistryInstallStore) ListEnabled(ctx context.Context) ([]store.RegistryInstallRecord, error)
- func (s *RegistryInstallStore) ListInstalled(ctx context.Context, filter store.RegistryInstallFilter) ([]store.RegistryInstallRecord, error)
- func (s *RegistryInstallStore) SetEnabled(ctx context.Context, record store.RegistryInstallRecord) error
- func (s *RegistryInstallStore) UpsertInstall(ctx context.Context, record store.RegistryInstallRecord) error
- type ResourceStore
- func (s *ResourceStore) Create(ctx context.Context, res *types.ResourceEnvelope) error
- func (s *ResourceStore) Delete(ctx context.Context, resourceType, id string) error
- func (s *ResourceStore) DeleteIfVersion(ctx context.Context, resourceType, id, expectedVersion string) (bool, error)
- func (s *ResourceStore) Exists(ctx context.Context, resourceType, id string) (bool, error)
- func (s *ResourceStore) ListIDs(ctx context.Context, resourceType string, limit, offset int) ([]string, error)
- func (s *ResourceStore) Read(ctx context.Context, resourceType, id string) (*types.ResourceEnvelope, error)
- func (s *ResourceStore) Update(ctx context.Context, res *types.ResourceEnvelope) error
- func (s *ResourceStore) UpdateIfVersion(ctx context.Context, res *types.ResourceEnvelope, expectedVersion string) (bool, error)
- type SQLiteBlobStore
- func (s *SQLiteBlobStore) AppendChunk(ctx context.Context, key string, index int, data []byte) error
- func (s *SQLiteBlobStore) Delete(ctx context.Context, blobID string) error
- func (s *SQLiteBlobStore) DeleteChunks(ctx context.Context, key string) error
- func (s *SQLiteBlobStore) Get(ctx context.Context, blobID string) ([]byte, *binary.BlobDescriptor, error)
- func (s *SQLiteBlobStore) Head(ctx context.Context, blobID string) (*binary.BlobDescriptor, error)
- func (s *SQLiteBlobStore) ListChunkCount(ctx context.Context, key string) (int, error)
- func (s *SQLiteBlobStore) Metadata() *BlobMetadataStore
- func (s *SQLiteBlobStore) Open(ctx context.Context, blobID string) (io.ReadCloser, *binary.BlobDescriptor, error)
- func (s *SQLiteBlobStore) Put(ctx context.Context, blobID string, data []byte, contentType string) (*binary.BlobDescriptor, error)
- func (s *SQLiteBlobStore) PutStream(ctx context.Context, blobID string, r io.Reader, size int64, ...) (*binary.BlobDescriptor, error)
- func (s *SQLiteBlobStore) ReadChunk(ctx context.Context, key string, index int) ([]byte, error)
- type SearchStore
- func (s *SearchStore) FieldValues(ctx context.Context, resourceType, fieldKey string, resourceIDs []string) (map[string]string, error)
- func (s *SearchStore) Index(ctx context.Context, entry store.SearchIndexEntry) error
- func (s *SearchStore) Lookup(ctx context.Context, key, value string) ([]string, error)
- func (s *SearchStore) LookupMatch(ctx context.Context, match store.SearchMatch) ([]string, error)
- func (s *SearchStore) QueryPrepared(ctx context.Context, query store.PreparedQuery, args map[string]string) ([]string, error)
- func (s *SearchStore) RemoveIndex(ctx context.Context, resourceType, id string) error
- type Session
- func (s *Session) BinaryMetadataStore() binary.MetadataStore
- func (s *Session) Commit(ctx context.Context) error
- func (s *Session) CursorStore() store.CursorStore
- func (s *Session) EventStore() store.EventStore
- func (s *Session) HistoryStore() store.HistoryStore
- func (s *Session) InboxStore() store.InboxStore
- func (s *Session) OutboxStore() store.EventStore
- func (s *Session) ResourceStore() store.ResourceStore
- func (s *Session) Rollback(ctx context.Context) error
- func (s *Session) SearchStore() store.SearchStore
- func (s *Session) TerminologyStore() store.TerminologyStore
- type SubscriptionDeliveryStore
- func (s *SubscriptionDeliveryStore) Append(ctx context.Context, record store.DeliveryRecord) error
- func (s *SubscriptionDeliveryStore) Get(ctx context.Context, id string) (*store.DeliveryRecord, error)
- func (s *SubscriptionDeliveryStore) List(ctx context.Context, query store.DeliveryListQuery) ([]store.DeliveryRecord, error)
- func (s *SubscriptionDeliveryStore) Update(ctx context.Context, record store.DeliveryRecord) error
- type SubscriptionStore
- func (s *SubscriptionStore) Create(ctx context.Context, record store.SubscriptionRecord) error
- func (s *SubscriptionStore) Delete(ctx context.Context, id string) error
- func (s *SubscriptionStore) Get(ctx context.Context, id string) (*store.SubscriptionRecord, error)
- func (s *SubscriptionStore) List(ctx context.Context, query store.SubscriptionListQuery) ([]store.SubscriptionRecord, error)
- func (s *SubscriptionStore) Update(ctx context.Context, record store.SubscriptionRecord) error
- type TerminologyInstallStore
- func (s *TerminologyInstallStore) Delete(ctx context.Context, filter store.TerminologyInstallFilter) error
- func (s *TerminologyInstallStore) ListEnabled(ctx context.Context) ([]store.TerminologyInstallRecord, error)
- func (s *TerminologyInstallStore) ListInstalled(ctx context.Context, filter store.TerminologyInstallFilter) ([]store.TerminologyInstallRecord, error)
- func (s *TerminologyInstallStore) SetEnabled(ctx context.Context, record store.TerminologyInstallRecord) error
- func (s *TerminologyInstallStore) UpsertInstall(ctx context.Context, record store.TerminologyInstallRecord) error
- type TerminologyInstallStoreFactory
- type TerminologyStore
- func (s *TerminologyStore) DeleteProjections(ctx context.Context, scope, typ, url, ver string) error
- func (s *TerminologyStore) DeleteResource(ctx context.Context, scope, typ, url, ver string) error
- func (s *TerminologyStore) FindResource(ctx context.Context, scope, typ, url, ver string) (*store.TerminologyResourceRecord, error)
- func (s *TerminologyStore) GetValueSet(ctx context.Context, scope, url, ver string) (*store.TerminologyValueSetRecord, error)
- func (s *TerminologyStore) ListResources(ctx context.Context, scope, typ string) ([]store.TerminologyResourceRecord, error)
- func (s *TerminologyStore) ListValueSetMembers(ctx context.Context, scope, url, ver string) ([]store.TerminologyExpansionMemberRecord, error)
- func (s *TerminologyStore) LookupConcept(ctx context.Context, scope, url, ver, code string) (*store.TerminologyConceptRecord, error)
- func (s *TerminologyStore) PutResource(ctx context.Context, r store.TerminologyResourceRecord) error
- func (s *TerminologyStore) ReplaceCodeSystem(ctx context.Context, scope, url, ver string, ...) error
- func (s *TerminologyStore) ReplaceValueSet(ctx context.Context, r store.TerminologyValueSetRecord, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditStore ¶
type AuditStore struct {
// contains filtered or unexported fields
}
AuditStore persists append-only audit records in SQLite.
func (*AuditStore) Append ¶
func (s *AuditStore) Append(ctx context.Context, record store.AuditRecord) error
Append implements store.AuditStore.
func (*AuditStore) List ¶
func (s *AuditStore) List(ctx context.Context, query store.AuditQuery) ([]store.AuditRecord, error)
List implements store.AuditStore.
type AuthStore ¶
type AuthStore struct {
// contains filtered or unexported fields
}
AuthStore persists auth data for one logical tenant in SQLite.
func (*AuthStore) DeleteDevice ¶
func (*AuthStore) DeletePolicy ¶
func (*AuthStore) DeletePrincipal ¶
func (*AuthStore) DeleteRole ¶
func (*AuthStore) DeleteTenantBinding ¶
func (*AuthStore) GetActivePolicy ¶
func (*AuthStore) GetPrincipal ¶
func (*AuthStore) GetTenantBinding ¶
func (*AuthStore) ListDevices ¶
func (*AuthStore) ListPolicies ¶
func (*AuthStore) ListPrincipals ¶
func (*AuthStore) ListTenantBindings ¶
func (*AuthStore) UpsertDevice ¶
func (*AuthStore) UpsertPolicy ¶
func (*AuthStore) UpsertPrincipal ¶
func (*AuthStore) UpsertRole ¶
func (*AuthStore) UpsertTenantBinding ¶
type BinaryStore ¶
type BinaryStore struct {
// contains filtered or unexported fields
}
BinaryStore persists small inline binary payloads in SQLite.
Inline keyed storage only; large blob offload and deduplication are out of scope here.
func (*BinaryStore) Get ¶
func (s *BinaryStore) Get(ctx context.Context, key string) (*store.BinaryObject, error)
func (*BinaryStore) Put ¶
func (s *BinaryStore) Put(ctx context.Context, obj store.BinaryObject) error
type BlobMetadataStore ¶
type BlobMetadataStore struct {
// contains filtered or unexported fields
}
BlobMetadataStore persists blob manifests, links, sync status, and transfer sessions.
func (*BlobMetadataStore) CreateDownloadSession ¶
func (s *BlobMetadataStore) CreateDownloadSession(ctx context.Context, session binary.DownloadSession) error
func (*BlobMetadataStore) CreateUploadSession ¶
func (s *BlobMetadataStore) CreateUploadSession(ctx context.Context, session binary.UploadSession) error
func (*BlobMetadataStore) DeleteBinaryLink ¶
func (s *BlobMetadataStore) DeleteBinaryLink(ctx context.Context, resourceID string) error
func (*BlobMetadataStore) DeleteDocumentLink ¶
func (*BlobMetadataStore) DeleteDownloadSession ¶
func (s *BlobMetadataStore) DeleteDownloadSession(ctx context.Context, id string) error
func (*BlobMetadataStore) DeleteManifest ¶
func (s *BlobMetadataStore) DeleteManifest(ctx context.Context, blobID string) error
func (*BlobMetadataStore) DeleteSyncStatus ¶
func (s *BlobMetadataStore) DeleteSyncStatus(ctx context.Context, blobID string) error
func (*BlobMetadataStore) DeleteUploadSession ¶
func (s *BlobMetadataStore) DeleteUploadSession(ctx context.Context, id string) error
func (*BlobMetadataStore) GetBinaryLink ¶
func (s *BlobMetadataStore) GetBinaryLink(ctx context.Context, resourceID string) (*binary.BinaryLink, error)
func (*BlobMetadataStore) GetDocumentLink ¶
func (s *BlobMetadataStore) GetDocumentLink(ctx context.Context, documentID string, contentIndex int) (*binary.DocumentAttachmentLink, error)
func (*BlobMetadataStore) GetDownloadSession ¶
func (s *BlobMetadataStore) GetDownloadSession(ctx context.Context, id string) (*binary.DownloadSession, error)
func (*BlobMetadataStore) GetManifest ¶
func (s *BlobMetadataStore) GetManifest(ctx context.Context, blobID string) (*binary.BlobManifest, error)
func (*BlobMetadataStore) GetManifestByHash ¶
func (s *BlobMetadataStore) GetManifestByHash(ctx context.Context, sha256 string) (*binary.BlobManifest, error)
func (*BlobMetadataStore) GetSyncStatus ¶
func (s *BlobMetadataStore) GetSyncStatus(ctx context.Context, blobID string) (binary.BlobSyncStatus, error)
func (*BlobMetadataStore) GetUploadSession ¶
func (s *BlobMetadataStore) GetUploadSession(ctx context.Context, id string) (*binary.UploadSession, error)
func (*BlobMetadataStore) PutBinaryLink ¶
func (s *BlobMetadataStore) PutBinaryLink(ctx context.Context, link binary.BinaryLink) error
func (*BlobMetadataStore) PutDocumentLink ¶
func (s *BlobMetadataStore) PutDocumentLink(ctx context.Context, link binary.DocumentAttachmentLink) error
func (*BlobMetadataStore) PutManifest ¶
func (s *BlobMetadataStore) PutManifest(ctx context.Context, manifest binary.BlobManifest) error
func (*BlobMetadataStore) PutSyncStatus ¶
func (s *BlobMetadataStore) PutSyncStatus(ctx context.Context, blobID string, status binary.BlobSyncStatus) error
func (*BlobMetadataStore) UpdateDownloadSession ¶
func (s *BlobMetadataStore) UpdateDownloadSession(ctx context.Context, session binary.DownloadSession) error
func (*BlobMetadataStore) UpdateUploadSession ¶
func (s *BlobMetadataStore) UpdateUploadSession(ctx context.Context, session binary.UploadSession) error
type ChunkBlobStore ¶
type ChunkBlobStore = SQLiteBlobStore
ChunkBlobStore is kept as a compatibility alias for earlier naming.
type ConflictStore ¶
type ConflictStore struct {
// contains filtered or unexported fields
}
ConflictStore persists sync and write conflicts in SQLite.
Append, List, and Resolve are supported. Conflict detection and reconciliation policy live outside this package.
func (*ConflictStore) Append ¶
func (s *ConflictStore) Append(ctx context.Context, record store.ConflictRecord) error
func (*ConflictStore) List ¶
func (s *ConflictStore) List(ctx context.Context, resourceType, resourceID string) ([]store.ConflictRecord, error)
type CursorStore ¶
type CursorStore struct {
// contains filtered or unexported fields
}
CursorStore persists named sync cursors in SQLite.
func (*CursorStore) DeleteCursor ¶
func (s *CursorStore) DeleteCursor(ctx context.Context, name string) error
func (*CursorStore) UpsertCursor ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB owns the shared SQLite connection, migration runner, and store constructors.
func OpenAndMigrate ¶
OpenAndMigrate opens a SQLite database and runs embedded migrations.
func (*DB) ApplyLocalWrite ¶
func (db *DB) ApplyLocalWrite(ctx context.Context, input LocalWrite) (*LocalWriteResult, error)
ApplyLocalWrite commits resource, history, outbox, and search changes atomically.
func (*DB) AuditStore ¶
func (db *DB) AuditStore() *AuditStore
AuditStore returns a connection-scoped audit store.
func (*DB) BeginSession ¶
BeginSession starts a new SQLite transaction session.
func (*DB) BeginWrite ¶
BeginWrite starts a new atomic write session.
func (*DB) BinaryStore ¶
func (db *DB) BinaryStore() *BinaryStore
BinaryStore returns a connection-scoped inline binary store.
func (*DB) BlobMetadataStore ¶
func (db *DB) BlobMetadataStore() *BlobMetadataStore
BlobMetadataStore returns a connection-scoped blob metadata store.
func (*DB) ChunkBlobStore ¶
func (db *DB) ChunkBlobStore() *ChunkBlobStore
ChunkBlobStore returns a connection-scoped chunked blob store.
func (*DB) ConflictStore ¶
func (db *DB) ConflictStore() *ConflictStore
ConflictStore returns a connection-scoped conflict store.
func (*DB) CursorStore ¶
func (db *DB) CursorStore() *CursorStore
CursorStore returns a connection-scoped cursor store.
func (*DB) DefinitionStore ¶
func (db *DB) DefinitionStore() *DefinitionStore
DefinitionStore returns a connection-scoped FHIR definition catalog store.
func (*DB) GlobalTerminologyStore ¶
func (db *DB) GlobalTerminologyStore() *TerminologyStore
GlobalTerminologyStore returns the platform-wide terminology catalog store.
func (*DB) HistoryStore ¶
func (db *DB) HistoryStore() *HistoryStore
HistoryStore returns a connection-scoped history store.
func (*DB) InboxStore ¶
func (db *DB) InboxStore() *InboxStore
InboxStore returns a connection-scoped inbox applied store.
func (*DB) ModuleStore ¶
func (db *DB) ModuleStore() *ModuleStore
ModuleStore returns a connection-scoped module registry store.
func (*DB) OutboxStore ¶
func (db *DB) OutboxStore() *OutboxStore
OutboxStore returns a connection-scoped outbox event store.
func (*DB) PackageInstallStore ¶
func (db *DB) PackageInstallStore() *PackageInstallStore
PackageInstallStore returns a connection-scoped package install completion store.
func (*DB) RegistryInstallStore ¶
func (db *DB) RegistryInstallStore() *RegistryInstallStore
RegistryInstallStore returns a connection-scoped registry install overlay store.
func (*DB) ResourceStore ¶
func (db *DB) ResourceStore() *ResourceStore
ResourceStore returns a connection-scoped resource store.
func (*DB) SQLiteBlobStore ¶
func (db *DB) SQLiteBlobStore() *SQLiteBlobStore
SQLiteBlobStore returns a connection-scoped chunked blob store.
func (*DB) SearchStore ¶
func (db *DB) SearchStore() *SearchStore
SearchStore returns a connection-scoped search store.
func (*DB) SubscriptionDeliveryStore ¶
func (db *DB) SubscriptionDeliveryStore() *SubscriptionDeliveryStore
SubscriptionDeliveryStore returns a connection-scoped delivery log store.
func (*DB) SubscriptionStore ¶
func (db *DB) SubscriptionStore() *SubscriptionStore
SubscriptionStore returns a connection-scoped subscription registry store.
func (*DB) TerminologyInstallStore ¶
func (db *DB) TerminologyInstallStore(tenantID string) *TerminologyInstallStore
TerminologyInstallStore returns a tenant-scoped terminology pack opt-in store.
func (*DB) TerminologyStore ¶
func (db *DB) TerminologyStore() *TerminologyStore
type DefinitionStore ¶
type DefinitionStore struct {
// contains filtered or unexported fields
}
DefinitionStore persists FHIR definition resources in SQLite.
func (*DefinitionStore) Delete ¶
func (s *DefinitionStore) Delete(ctx context.Context, canonicalURL, version string) error
func (*DefinitionStore) Get ¶
func (s *DefinitionStore) Get(ctx context.Context, canonicalURL, version string) (*store.DefinitionResourceRecord, error)
func (*DefinitionStore) List ¶
func (s *DefinitionStore) List(ctx context.Context, filter store.DefinitionFilter) ([]store.DefinitionResourceRecord, error)
func (*DefinitionStore) Upsert ¶
func (s *DefinitionStore) Upsert(ctx context.Context, record store.DefinitionResourceRecord, targets []store.DefinitionTargetRecord) error
type HistoryStore ¶
type HistoryStore struct {
// contains filtered or unexported fields
}
HistoryStore persists immutable resource version history in SQLite.
func (*HistoryStore) AppendVersion ¶
func (s *HistoryStore) AppendVersion(ctx context.Context, version store.ResourceVersion) error
func (*HistoryStore) GetHistory ¶
func (s *HistoryStore) GetHistory(ctx context.Context, resourceType, id string) ([]store.ResourceVersion, error)
func (*HistoryStore) GetVersion ¶
func (s *HistoryStore) GetVersion(ctx context.Context, resourceType, id, versionID string) (store.ResourceVersion, error)
type InboxStore ¶
type InboxStore struct {
// contains filtered or unexported fields
}
InboxStore tracks applied remote sync operations for idempotency.
MarkApplied, IsApplied, and AppliedAt implement store.InboxStore.
func (*InboxStore) GetAckPayload ¶
GetAckPayload returns the stored push acknowledgement, if the inbox row exists. Pull inbox rows have no acknowledgement payload.
func (*InboxStore) IsApplied ¶
IsApplied reports whether a remote operation has already been applied.
func (*InboxStore) MarkApplied ¶
MarkApplied records that a remote operation has been applied locally.
func (*InboxStore) MarkAppliedWithPayload ¶
func (s *InboxStore) MarkAppliedWithPayload(ctx context.Context, id string, payload []byte, appliedAt time.Time) error
MarkAppliedWithPayload records a hub acknowledgement together with the idempotency marker. Existing acknowledgement payloads are preserved on an idempotent retry.
type JobStore ¶
type JobStore struct {
// contains filtered or unexported fields
}
JobStore persists background jobs in SQLite.
func (*JobStore) ClaimNext ¶
ClaimNext implements store.JobStore with Postgres-compatible claim semantics.
type LocalWrite ¶
type LocalWrite struct {
Resource *types.ResourceEnvelope
Action store.VersionAction
SearchEntries []store.SearchIndexEntry
Event store.ResourceEvent
Version store.ResourceVersion
}
LocalWrite bundles the inputs for one atomic local write pipeline.
type LocalWriteResult ¶
type LocalWriteResult struct {
Version store.ResourceVersion
Event store.ResourceEvent
}
LocalWriteResult returns persisted write outputs.
type ModuleStore ¶
type ModuleStore struct {
// contains filtered or unexported fields
}
ModuleStore persists local module registration metadata in SQLite.
Name, version, and metadata only; module code loading and activation policy live elsewhere.
func (*ModuleStore) Get ¶
func (s *ModuleStore) Get(ctx context.Context, name string) (*store.ModuleRecord, error)
func (*ModuleStore) List ¶
func (s *ModuleStore) List(ctx context.Context) ([]store.ModuleRecord, error)
func (*ModuleStore) Register ¶
func (s *ModuleStore) Register(ctx context.Context, module store.ModuleRecord) error
func (*ModuleStore) Unregister ¶
func (s *ModuleStore) Unregister(ctx context.Context, name string) error
type Option ¶
type Option func(*options)
Option configures an opened SQLite database.
func WithBusyTimeout ¶
WithBusyTimeout sets the SQLite busy timeout for lock contention.
type OutboxStore ¶
type OutboxStore struct {
// contains filtered or unexported fields
}
OutboxStore persists append-only sync outbox events in SQLite.
func (*OutboxStore) Append ¶
func (s *OutboxStore) Append(ctx context.Context, event store.ResourceEvent) (store.ResourceEvent, error)
func (*OutboxStore) LatestForResource ¶
func (s *OutboxStore) LatestForResource(ctx context.Context, resourceType, id string) (*store.ResourceEvent, error)
func (*OutboxStore) ReadSince ¶
func (s *OutboxStore) ReadSince(ctx context.Context, afterSequence int64, limit int) ([]store.ResourceEvent, error)
type PackageInstallStore ¶
type PackageInstallStore struct {
// contains filtered or unexported fields
}
PackageInstallStore tracks completed FHIR package version installs in SQLite.
func (*PackageInstallStore) IsComplete ¶
func (*PackageInstallStore) MarkComplete ¶
type RegistryInstallStore ¶
type RegistryInstallStore struct {
// contains filtered or unexported fields
}
RegistryInstallStore persists local registry enablement and install references in SQLite.
func (*RegistryInstallStore) Delete ¶
func (s *RegistryInstallStore) Delete(ctx context.Context, filter store.RegistryInstallFilter) error
func (*RegistryInstallStore) ListEnabled ¶
func (s *RegistryInstallStore) ListEnabled(ctx context.Context) ([]store.RegistryInstallRecord, error)
func (*RegistryInstallStore) ListInstalled ¶
func (s *RegistryInstallStore) ListInstalled(ctx context.Context, filter store.RegistryInstallFilter) ([]store.RegistryInstallRecord, error)
func (*RegistryInstallStore) SetEnabled ¶
func (s *RegistryInstallStore) SetEnabled(ctx context.Context, record store.RegistryInstallRecord) error
func (*RegistryInstallStore) UpsertInstall ¶
func (s *RegistryInstallStore) UpsertInstall(ctx context.Context, record store.RegistryInstallRecord) error
type ResourceStore ¶
type ResourceStore struct {
// contains filtered or unexported fields
}
ResourceStore persists current resource state in SQLite.
func (*ResourceStore) Create ¶
func (s *ResourceStore) Create(ctx context.Context, res *types.ResourceEnvelope) error
func (*ResourceStore) Delete ¶
func (s *ResourceStore) Delete(ctx context.Context, resourceType, id string) error
func (*ResourceStore) DeleteIfVersion ¶
func (s *ResourceStore) DeleteIfVersion(ctx context.Context, resourceType, id, expectedVersion string) (bool, error)
DeleteIfVersion atomically deletes a resource only when its current version matches expectedVersion. The wildcard version "*" matches any existing version.
func (*ResourceStore) ListIDs ¶
func (s *ResourceStore) ListIDs(ctx context.Context, resourceType string, limit, offset int) ([]string, error)
ListIDs returns resource IDs for one type in stable id order.
func (*ResourceStore) Read ¶
func (s *ResourceStore) Read(ctx context.Context, resourceType, id string) (*types.ResourceEnvelope, error)
func (*ResourceStore) Update ¶
func (s *ResourceStore) Update(ctx context.Context, res *types.ResourceEnvelope) error
func (*ResourceStore) UpdateIfVersion ¶
func (s *ResourceStore) UpdateIfVersion(ctx context.Context, res *types.ResourceEnvelope, expectedVersion string) (bool, error)
UpdateIfVersion atomically replaces a resource only when its current version matches expectedVersion. The wildcard version "*" matches any existing version.
type SQLiteBlobStore ¶
type SQLiteBlobStore struct {
// contains filtered or unexported fields
}
SQLiteBlobStore persists full blob bytes in SQLite via chunk and manifest tables.
func (*SQLiteBlobStore) AppendChunk ¶
func (s *SQLiteBlobStore) AppendChunk(ctx context.Context, key string, index int, data []byte) error
AppendChunk stores one chunk for a blob or staging key.
func (*SQLiteBlobStore) Delete ¶
func (s *SQLiteBlobStore) Delete(ctx context.Context, blobID string) error
Delete removes blob chunks and manifest.
func (*SQLiteBlobStore) DeleteChunks ¶
func (s *SQLiteBlobStore) DeleteChunks(ctx context.Context, key string) error
DeleteChunks removes all chunks for a key.
func (*SQLiteBlobStore) Get ¶
func (s *SQLiteBlobStore) Get(ctx context.Context, blobID string) ([]byte, *binary.BlobDescriptor, error)
Get reads a finalized blob by assembling stored chunks.
func (*SQLiteBlobStore) Head ¶
func (s *SQLiteBlobStore) Head(ctx context.Context, blobID string) (*binary.BlobDescriptor, error)
Head returns blob metadata without reading payload bytes.
func (*SQLiteBlobStore) ListChunkCount ¶
ListChunkCount returns contiguous chunk count starting at index 0.
func (*SQLiteBlobStore) Metadata ¶
func (s *SQLiteBlobStore) Metadata() *BlobMetadataStore
Metadata returns the metadata store sharing this connection.
func (*SQLiteBlobStore) Open ¶
func (s *SQLiteBlobStore) Open(ctx context.Context, blobID string) (io.ReadCloser, *binary.BlobDescriptor, error)
Open streams a finalized blob one chunk at a time.
func (*SQLiteBlobStore) Put ¶
func (s *SQLiteBlobStore) Put(ctx context.Context, blobID string, data []byte, contentType string) (*binary.BlobDescriptor, error)
Put stores a finalized blob as chunked bytes in SQLite.
type SearchStore ¶
type SearchStore struct {
// contains filtered or unexported fields
}
SearchStore persists typed search index rows in SQLite.
func (*SearchStore) FieldValues ¶
func (s *SearchStore) FieldValues(ctx context.Context, resourceType, fieldKey string, resourceIDs []string) (map[string]string, error)
FieldValues returns one indexed value per resource ID for a typed field key.
func (*SearchStore) Index ¶
func (s *SearchStore) Index(ctx context.Context, entry store.SearchIndexEntry) error
func (*SearchStore) LookupMatch ¶
func (s *SearchStore) LookupMatch(ctx context.Context, match store.SearchMatch) ([]string, error)
LookupMatch returns resource IDs matching one typed predicate within a resource type.
func (*SearchStore) QueryPrepared ¶
func (s *SearchStore) QueryPrepared(ctx context.Context, query store.PreparedQuery, args map[string]string) ([]string, error)
func (*SearchStore) RemoveIndex ¶
func (s *SearchStore) RemoveIndex(ctx context.Context, resourceType, id string) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session coordinates transaction-scoped store access for atomic local writes.
func (*Session) BinaryMetadataStore ¶
func (s *Session) BinaryMetadataStore() binary.MetadataStore
BinaryMetadataStore returns the transaction-scoped blob metadata store.
func (*Session) CursorStore ¶
func (s *Session) CursorStore() store.CursorStore
CursorStore returns the transaction-scoped cursor store.
func (*Session) EventStore ¶
func (s *Session) EventStore() store.EventStore
EventStore returns the transaction-scoped event store.
func (*Session) HistoryStore ¶
func (s *Session) HistoryStore() store.HistoryStore
HistoryStore returns the transaction-scoped history store.
func (*Session) InboxStore ¶
func (s *Session) InboxStore() store.InboxStore
InboxStore returns the transaction-scoped sync inbox store.
func (*Session) OutboxStore ¶
func (s *Session) OutboxStore() store.EventStore
OutboxStore returns the transaction-scoped outbox event store.
func (*Session) ResourceStore ¶
func (s *Session) ResourceStore() store.ResourceStore
ResourceStore returns the transaction-scoped resource store.
func (*Session) SearchStore ¶
func (s *Session) SearchStore() store.SearchStore
SearchStore returns the transaction-scoped search store.
func (*Session) TerminologyStore ¶
func (s *Session) TerminologyStore() store.TerminologyStore
TerminologyStore returns the transaction-scoped terminology projection store.
type SubscriptionDeliveryStore ¶
type SubscriptionDeliveryStore struct {
// contains filtered or unexported fields
}
SubscriptionDeliveryStore persists delivery logs in SQLite.
func (*SubscriptionDeliveryStore) Append ¶
func (s *SubscriptionDeliveryStore) Append(ctx context.Context, record store.DeliveryRecord) error
Append implements store.SubscriptionDeliveryStore.
func (*SubscriptionDeliveryStore) Get ¶
func (s *SubscriptionDeliveryStore) Get(ctx context.Context, id string) (*store.DeliveryRecord, error)
Get implements store.SubscriptionDeliveryStore.
func (*SubscriptionDeliveryStore) List ¶
func (s *SubscriptionDeliveryStore) List(ctx context.Context, query store.DeliveryListQuery) ([]store.DeliveryRecord, error)
List implements store.SubscriptionDeliveryStore.
func (*SubscriptionDeliveryStore) Update ¶
func (s *SubscriptionDeliveryStore) Update(ctx context.Context, record store.DeliveryRecord) error
Update implements store.SubscriptionDeliveryStore.
type SubscriptionStore ¶
type SubscriptionStore struct {
// contains filtered or unexported fields
}
SubscriptionStore persists subscription definitions in SQLite.
func (*SubscriptionStore) Create ¶
func (s *SubscriptionStore) Create(ctx context.Context, record store.SubscriptionRecord) error
Create implements store.SubscriptionStore.
func (*SubscriptionStore) Delete ¶
func (s *SubscriptionStore) Delete(ctx context.Context, id string) error
Delete implements store.SubscriptionStore.
func (*SubscriptionStore) Get ¶
func (s *SubscriptionStore) Get(ctx context.Context, id string) (*store.SubscriptionRecord, error)
Get implements store.SubscriptionStore.
func (*SubscriptionStore) List ¶
func (s *SubscriptionStore) List(ctx context.Context, query store.SubscriptionListQuery) ([]store.SubscriptionRecord, error)
List implements store.SubscriptionStore.
func (*SubscriptionStore) Update ¶
func (s *SubscriptionStore) Update(ctx context.Context, record store.SubscriptionRecord) error
Update implements store.SubscriptionStore.
type TerminologyInstallStore ¶
type TerminologyInstallStore struct {
// contains filtered or unexported fields
}
TerminologyInstallStore persists tenant-scoped terminology pack enablement.
func (*TerminologyInstallStore) Delete ¶
func (s *TerminologyInstallStore) Delete(ctx context.Context, filter store.TerminologyInstallFilter) error
func (*TerminologyInstallStore) ListEnabled ¶
func (s *TerminologyInstallStore) ListEnabled(ctx context.Context) ([]store.TerminologyInstallRecord, error)
func (*TerminologyInstallStore) ListInstalled ¶
func (s *TerminologyInstallStore) ListInstalled(ctx context.Context, filter store.TerminologyInstallFilter) ([]store.TerminologyInstallRecord, error)
func (*TerminologyInstallStore) SetEnabled ¶
func (s *TerminologyInstallStore) SetEnabled(ctx context.Context, record store.TerminologyInstallRecord) error
func (*TerminologyInstallStore) UpsertInstall ¶
func (s *TerminologyInstallStore) UpsertInstall(ctx context.Context, record store.TerminologyInstallRecord) error
type TerminologyInstallStoreFactory ¶
type TerminologyInstallStoreFactory struct {
// contains filtered or unexported fields
}
TerminologyInstallStoreFactory resolves SQLite terminology opt-in stores per tenant.
func NewTerminologyInstallStoreFactory ¶
func NewTerminologyInstallStoreFactory(db *DB) *TerminologyInstallStoreFactory
NewTerminologyInstallStoreFactory returns a factory backed by db.
func (*TerminologyInstallStoreFactory) ForTenant ¶
func (f *TerminologyInstallStoreFactory) ForTenant(_ context.Context, tenantID string) (store.TerminologyInstallStore, error)
ForTenant returns the terminology install store for tenantID.
type TerminologyStore ¶
type TerminologyStore struct {
// contains filtered or unexported fields
}
func (*TerminologyStore) DeleteProjections ¶
func (s *TerminologyStore) DeleteProjections(ctx context.Context, scope, typ, url, ver string) error
func (*TerminologyStore) DeleteResource ¶
func (s *TerminologyStore) DeleteResource(ctx context.Context, scope, typ, url, ver string) error
func (*TerminologyStore) FindResource ¶
func (s *TerminologyStore) FindResource(ctx context.Context, scope, typ, url, ver string) (*store.TerminologyResourceRecord, error)
func (*TerminologyStore) GetValueSet ¶
func (s *TerminologyStore) GetValueSet(ctx context.Context, scope, url, ver string) (*store.TerminologyValueSetRecord, error)
func (*TerminologyStore) ListResources ¶
func (s *TerminologyStore) ListResources(ctx context.Context, scope, typ string) ([]store.TerminologyResourceRecord, error)
func (*TerminologyStore) ListValueSetMembers ¶
func (s *TerminologyStore) ListValueSetMembers(ctx context.Context, scope, url, ver string) ([]store.TerminologyExpansionMemberRecord, error)
func (*TerminologyStore) LookupConcept ¶
func (s *TerminologyStore) LookupConcept(ctx context.Context, scope, url, ver, code string) (*store.TerminologyConceptRecord, error)
func (*TerminologyStore) PutResource ¶
func (s *TerminologyStore) PutResource(ctx context.Context, r store.TerminologyResourceRecord) error
func (*TerminologyStore) ReplaceCodeSystem ¶
func (s *TerminologyStore) ReplaceCodeSystem(ctx context.Context, scope, url, ver string, cs []store.TerminologyConceptRecord) error
func (*TerminologyStore) ReplaceValueSet ¶
func (s *TerminologyStore) ReplaceValueSet(ctx context.Context, r store.TerminologyValueSetRecord, ms []store.TerminologyExpansionMemberRecord) error
Source Files
¶
- audit_store.go
- auth_store.go
- binary_store.go
- blob_metadata_store.go
- blob_store.go
- conflict_store.go
- cursor_store.go
- db.go
- definition_store.go
- doc.go
- history_store.go
- inbox_store.go
- job_store.go
- migrate.go
- module_store.go
- options.go
- outbox_store.go
- package_install_store.go
- registry_install_store.go
- resource_store.go
- search_store.go
- session.go
- subscription_delivery_store.go
- subscription_store.go
- terminology_install_factory.go
- terminology_install_store.go
- terminology_store.go
- timeutil.go