sqlite

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

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

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

func NewStore(dataDir string) (*Store, error)

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) Close

func (s *Store) Close() error

Close closes the database connection.

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) Path

func (s *Store) Path() string

Path returns the database file path.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL