sqlite

package
v0.11.0-nightly.20240713 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(ctx context.Context, l log.CtxLogger, path, table string) (*DB, error)

New initializes the database structures needed by DB.

func (*DB) Close

func (d *DB) Close() error

Close closes all open connections.

func (*DB) Get

func (d *DB) Get(ctx context.Context, key string) ([]byte, error)

func (*DB) GetKeys

func (d *DB) GetKeys(ctx context.Context, prefix string) ([]string, error)

func (*DB) NewTransaction

func (d *DB) NewTransaction(ctx context.Context, update bool) (database.Transaction, context.Context, error)

NewTransaction starts a new transaction. The `update` parameter controls the access mode ("read only" or "read write"). It returns the transaction as well as a context that contains the transaction. Passing the context in future calls to *DB will execute that action in that transaction.

func (*DB) Ping

func (d *DB) Ping(ctx context.Context) error

func (*DB) Set

func (d *DB) Set(ctx context.Context, key string, v []byte) error

Set will store the value under the key. If value is `nil` we consider that a delete.

type Transaction

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

func (*Transaction) Commit

func (t *Transaction) Commit() error

func (*Transaction) Discard

func (t *Transaction) Discard()

Jump to

Keyboard shortcuts

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