sqlite

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TODO: Make configurable
	ImportCommitBatchSize = 10000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func NewBatch

func NewBatch(storage *sql.DB, version int64) (*Batch, error)

func (*Batch) Delete

func (b *Batch) Delete(storeKey string, key []byte) error

func (*Batch) Reset

func (b *Batch) Reset()

func (*Batch) Set

func (b *Batch) Set(storeKey string, key, value []byte) error

func (*Batch) Size

func (b *Batch) Size() int

func (*Batch) Write

func (b *Batch) Write() error

type Database

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

func New

func New(dataDir string) (*Database, error)

func (*Database) ApplyChangeset

func (db *Database) ApplyChangeset(version int64, cs *proto.NamedChangeSet) error

func (*Database) Close

func (db *Database) Close() error

func (*Database) Get

func (db *Database) Get(storeKey string, targetVersion int64, key []byte) ([]byte, error)

func (*Database) GetLatestVersion

func (db *Database) GetLatestVersion() (int64, error)

func (*Database) Has

func (db *Database) Has(storeKey string, version int64, key []byte) (bool, error)

func (*Database) Import

func (db *Database) Import(version int64, ch <-chan sstypes.ImportEntry) error

Import loads the initial version of the state TODO: Parallelize Import

func (*Database) Iterator

func (db *Database) Iterator(storeKey string, version int64, start, end []byte) (types.Iterator, error)

func (*Database) PrintRowsDebug

func (db *Database) PrintRowsDebug()

func (*Database) Prune

func (db *Database) Prune(version int64) error

func (*Database) ReverseIterator

func (db *Database) ReverseIterator(storeKey string, version int64, start, end []byte) (types.Iterator, error)

func (*Database) SetLatestVersion

func (db *Database) SetLatestVersion(version int64) error

Jump to

Keyboard shortcuts

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