Documentation
¶
Overview ¶
Package sqlite provides a unified SQLite-based implementation of driven port interfaces.
This adapter uses modernc.org/sqlite, a pure Go SQLite implementation that requires no CGO, enabling easy cross-compilation. It implements multiple store interfaces through a single database connection:
- SourceStore: Source configuration persistence
- DocumentStore: Document and chunk persistence
- SyncStateStore: Sync progress persistence
- ExclusionStore: Document exclusion persistence
- AuthorizationStore: OAuth credentials persistence
Schema ¶
The database schema is managed through versioned migrations stored in the migrations/ directory. Each migration is a pair of .up.sql and .down.sql files.
Data Location ¶
By default, the database is stored at ~/.sercha/data/metadata.db
Thread Safety ¶
All operations are thread-safe. The store uses database-level locking provided by SQLite in WAL mode.
Index ¶
- type Store
- func (s *Store) AuthProviderStore() driven.AuthProviderStore
- func (s *Store) Close() error
- func (s *Store) CredentialsStore() driven.CredentialsStore
- func (s *Store) DocumentStore() driven.DocumentStore
- func (s *Store) ExclusionStore() driven.ExclusionStore
- func (s *Store) Path() string
- func (s *Store) SchedulerStore() driven.SchedulerStore
- func (s *Store) SourceStore() driven.SourceStore
- func (s *Store) SyncStateStore() driven.SyncStateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a unified SQLite-based storage that provides access to all metadata store interfaces through wrapper types.
func NewStore ¶
NewStore creates a new SQLite store at the specified data directory. If dataDir is empty, defaults to ~/.sercha/data/metadata.db.
func (*Store) AuthProviderStore ¶
func (s *Store) AuthProviderStore() driven.AuthProviderStore
AuthProviderStore returns an AuthProviderStore interface backed by this store.
func (*Store) CredentialsStore ¶
func (s *Store) CredentialsStore() driven.CredentialsStore
CredentialsStore returns a CredentialsStore interface backed by this store.
func (*Store) DocumentStore ¶
func (s *Store) DocumentStore() driven.DocumentStore
DocumentStore returns a DocumentStore interface backed by this store.
func (*Store) ExclusionStore ¶
func (s *Store) ExclusionStore() driven.ExclusionStore
ExclusionStore returns an ExclusionStore interface backed by this store.
func (*Store) SchedulerStore ¶
func (s *Store) SchedulerStore() driven.SchedulerStore
SchedulerStore returns a SchedulerStore interface backed by this store.
func (*Store) SourceStore ¶
func (s *Store) SourceStore() driven.SourceStore
SourceStore returns a SourceStore interface backed by this store.
func (*Store) SyncStateStore ¶
func (s *Store) SyncStateStore() driven.SyncStateStore
SyncStateStore returns a SyncStateStore interface backed by this store.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package migrations embeds SQL migration files for the SQLite store.
|
Package migrations embeds SQL migration files for the SQLite store. |