Documentation
¶
Overview ¶
Package sqlite implements the storage.Store interface using SQLite via github.com/mattn/go-sqlite3.
Index ¶
- type SQLiteStore
- func (s *SQLiteStore) AddAuditEntry(ctx context.Context, id string, entry schema.AuditEntry) error
- func (s *SQLiteStore) AddRelation(ctx context.Context, sourceID string, rel schema.Relation) error
- func (s *SQLiteStore) Begin(ctx context.Context) (storage.Transaction, error)
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) Create(ctx context.Context, rec *schema.MemoryRecord) error
- func (s *SQLiteStore) Delete(ctx context.Context, id string) error
- func (s *SQLiteStore) Get(ctx context.Context, id string) (*schema.MemoryRecord, error)
- func (s *SQLiteStore) GetRelations(ctx context.Context, id string) ([]schema.Relation, error)
- func (s *SQLiteStore) List(ctx context.Context, opts storage.ListOptions) ([]*schema.MemoryRecord, error)
- func (s *SQLiteStore) ListByType(ctx context.Context, memType schema.MemoryType) ([]*schema.MemoryRecord, error)
- func (s *SQLiteStore) Update(ctx context.Context, rec *schema.MemoryRecord) error
- func (s *SQLiteStore) UpdateSalience(ctx context.Context, id string, salience float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore implements storage.Store backed by a SQLite database.
func Open ¶
func Open(dsn string, encryptionKey string) (*SQLiteStore, error)
Open creates a new SQLiteStore at the given DSN (file path or ":memory:"). If encryptionKey is non-empty, the database is encrypted using SQLCipher. It initializes the database schema on first use.
func (*SQLiteStore) AddAuditEntry ¶
func (s *SQLiteStore) AddAuditEntry(ctx context.Context, id string, entry schema.AuditEntry) error
func (*SQLiteStore) AddRelation ¶
func (*SQLiteStore) Begin ¶
func (s *SQLiteStore) Begin(ctx context.Context) (storage.Transaction, error)
Begin starts a new database transaction.
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
Close closes the underlying database connection.
func (*SQLiteStore) Create ¶
func (s *SQLiteStore) Create(ctx context.Context, rec *schema.MemoryRecord) error
func (*SQLiteStore) Get ¶
func (s *SQLiteStore) Get(ctx context.Context, id string) (*schema.MemoryRecord, error)
func (*SQLiteStore) GetRelations ¶
func (*SQLiteStore) List ¶
func (s *SQLiteStore) List(ctx context.Context, opts storage.ListOptions) ([]*schema.MemoryRecord, error)
func (*SQLiteStore) ListByType ¶
func (s *SQLiteStore) ListByType(ctx context.Context, memType schema.MemoryType) ([]*schema.MemoryRecord, error)
func (*SQLiteStore) Update ¶
func (s *SQLiteStore) Update(ctx context.Context, rec *schema.MemoryRecord) error
func (*SQLiteStore) UpdateSalience ¶
Click to show internal directories.
Click to hide internal directories.