sqlite

package
v0.0.0-...-0643f43 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

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
}

func NewStore

func NewStore(path string, opts collection.Options) (*Store, error)

func (*Store) Backup

func (s *Store) Backup(ctx context.Context, destPath string) error

Backup creates an online backup of the database to the specified path. This method is WAL-friendly and allows concurrent reads/writes during backup. It uses SQLite's online backup mechanism through a dedicated connection.

func (*Store) BackupOnline

func (s *Store) BackupOnline(ctx context.Context, destPath string, pagesBatchSize int) error

BackupOnline creates an online backup using incremental page copying. This minimizes lock time by copying pages in small batches. Best for very large databases where VACUUM INTO might take too long.

func (*Store) Checkpoint

func (s *Store) Checkpoint(ctx context.Context) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountRecords

func (s *Store) CountRecords(ctx context.Context) (int64, error)

func (*Store) CreateRecord

func (s *Store) CreateRecord(ctx context.Context, r *pb.CollectionRecord) error

func (*Store) DeleteRecord

func (s *Store) DeleteRecord(ctx context.Context, id string) error

func (*Store) ExecuteRaw

func (s *Store) ExecuteRaw(q string, args ...interface{}) error

func (*Store) GetRecord

func (s *Store) GetRecord(ctx context.Context, id string) (*pb.CollectionRecord, error)

func (*Store) ListRecords

func (s *Store) ListRecords(ctx context.Context, offset, limit int) ([]*pb.CollectionRecord, error)

func (*Store) Path

func (s *Store) Path() string

func (*Store) ReIndex

func (s *Store) ReIndex(ctx context.Context) error

func (*Store) Search

func (*Store) SetJSONConverter

func (s *Store) SetJSONConverter(conv collection.ProtoToJSONConverter)

SetJSONConverter sets the function used to convert binary proto_data to JSON for the jsontext column. This must be called before CreateRecord/UpdateRecord if EnableJSON is true and proto_data contains binary protobuf.

func (*Store) UpdateRecord

func (s *Store) UpdateRecord(ctx context.Context, r *pb.CollectionRecord) error

Jump to

Keyboard shortcuts

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