sqlite

package
v1.8.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncompatibleVersion = fmt.Errorf("incompatible schema version")
)

Functions

func NewBackend

func NewBackend(ctx context.Context, config *BackendConfig) (limited.Backend, error)

Types

type BackendConfig

type BackendConfig struct {
	limited.Config
	//DriverConfig is the sqlite driver config
	DriverConfig *DriverConfig
}

type Driver

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

func NewDriver

func NewDriver(ctx context.Context, config *DriverConfig) (*Driver, error)

func (*Driver) After

func (d *Driver) After(ctx context.Context, rev, limit int64) (*sql.Rows, error)

func (*Driver) AfterPrefix

func (d *Driver) AfterPrefix(ctx context.Context, key, rangeEnd []byte, startRevision, endRevision int64) (*sql.Rows, error)

func (*Driver) Close

func (d *Driver) Close() error

func (*Driver) Compact

func (d *Driver) Compact(ctx context.Context, revision int64) (err error)

Compact compacts the database up to the revision provided in the method's call. After the call, any request for a version older than the given revision will return a compacted error.

func (*Driver) Count

func (d *Driver) Count(ctx context.Context, key, rangeEnd []byte, revision int64) (int64, error)

func (*Driver) Create

func (d *Driver) Create(ctx context.Context, key, value []byte, ttl int64) (rev int64, succeeded bool, err error)

func (*Driver) CurrentRevision

func (d *Driver) CurrentRevision(ctx context.Context) (int64, error)

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, key []byte, revision int64) (rev int64, deleted bool, err error)

func (*Driver) DeleteRevision

func (d *Driver) DeleteRevision(ctx context.Context, revision int64) error

func (*Driver) GetCompactRevision

func (d *Driver) GetCompactRevision(ctx context.Context) (int64, int64, error)

func (*Driver) GetSize

func (d *Driver) GetSize(ctx context.Context) (int64, error)

func (*Driver) List

func (d *Driver) List(ctx context.Context, key, rangeEnd []byte, limit, revision int64) (*sql.Rows, error)

func (*Driver) ListTTL

func (d *Driver) ListTTL(ctx context.Context, revision int64) (*sql.Rows, error)

func (*Driver) Update

func (d *Driver) Update(ctx context.Context, key, value []byte, preRev, ttl int64) (rev int64, updated bool, err error)

type DriverConfig

type DriverConfig struct {
	DB    database.Interface
	Retry func(error) bool
}

type SchemaVersion

type SchemaVersion int32

func NewSchemaVersion

func NewSchemaVersion(major int16, minor int16) SchemaVersion

func (SchemaVersion) CompatibleWith

func (sv SchemaVersion) CompatibleWith(targetSV SchemaVersion) error

func (SchemaVersion) Major

func (sv SchemaVersion) Major() int16

func (SchemaVersion) Minor

func (sv SchemaVersion) Minor() int16

Jump to

Keyboard shortcuts

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