sqlite

package
v1.6.32 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQueryTimeout = errors.New("query timeout")
)

Errors.

Functions

This section is empty.

Types

type SQLite

type SQLite struct {
	// contains filtered or unexported fields
}

SQLite storage.

func NewSQLite

func NewSQLite(name, location string) (*SQLite, error)

NewSQLite creates a sqlite database.

func (*SQLite) Delete

func (db *SQLite) Delete(key string) error

Delete deletes a record from the database.

func (*SQLite) Get

func (db *SQLite) Get(key string) (record.Record, error)

Get returns a database record.

func (*SQLite) GetMeta

func (db *SQLite) GetMeta(key string) (*record.Meta, error)

GetMeta returns the metadata of a database record.

func (*SQLite) Injected

func (db *SQLite) Injected() bool

Injected returns whether the database is injected.

func (*SQLite) Maintain

func (db *SQLite) Maintain(ctx context.Context) error

func (*SQLite) MaintainRecordStates

func (db *SQLite) MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time, shadowDelete bool) error

MaintainRecordStates maintains records states in the database.

func (*SQLite) MaintainThorough

func (db *SQLite) MaintainThorough(ctx context.Context) error

func (*SQLite) Purge

func (db *SQLite) Purge(ctx context.Context, q *query.Query, local, internal, shadowDelete bool) (int, error)

Purge deletes all records that match the given query. It returns the number of successful deletes and an error.

func (*SQLite) PurgeOlderThan added in v1.6.32

func (db *SQLite) PurgeOlderThan(ctx context.Context, prefix string, purgeBefore time.Time, local, internal, shadowDelete bool) (int, error)

PurgeOlderThan deletes all records last updated before the given time. It returns the number of successful deletes and an error.

func (*SQLite) Put

func (db *SQLite) Put(r record.Record) (record.Record, error)

Put stores a record in the database.

func (*SQLite) PutMany

func (db *SQLite) PutMany(shadowDelete bool) (chan<- record.Record, <-chan error)

PutMany stores many records in the database.

func (*SQLite) Query

func (db *SQLite) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)

Query returns a an iterator for the supplied query.

func (*SQLite) ReadOnly

func (db *SQLite) ReadOnly() bool

ReadOnly returns whether the database is read only.

func (*SQLite) Shutdown

func (db *SQLite) Shutdown() error

Shutdown shuts down the database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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