Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v1.14.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSQLiteStateStore

func NewSQLiteStateStore(logger logger.Logger) state.Store

NewSQLiteStateStore creates a new instance of the SQLite state store.

Types

type DBAccess

type DBAccess interface {
	Init(ctx context.Context, metadata state.Metadata) error
	Ping(ctx context.Context) error
	Set(ctx context.Context, req *state.SetRequest) error
	Get(ctx context.Context, req *state.GetRequest) (*state.GetResponse, error)
	Delete(ctx context.Context, req *state.DeleteRequest) error
	BulkGet(ctx context.Context, req []state.GetRequest) ([]state.BulkGetResponse, error)
	ExecuteMulti(ctx context.Context, reqs []state.TransactionalStateOperation) error
	Close() error
}

DBAccess is a private interface which enables unit testing of SQLite.

type SQLiteStore

type SQLiteStore struct {
	state.BulkStore
	// contains filtered or unexported fields
}

SQLite Database state store.

func (*SQLiteStore) BulkGet

BulkGet performs a bulks get operations. Options are ignored because this component requests all values in a single query.

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

Close implements io.Closer.

func (*SQLiteStore) Delete

func (s *SQLiteStore) Delete(ctx context.Context, req *state.DeleteRequest) error

Delete removes an entity from the store.

func (*SQLiteStore) Features

func (s *SQLiteStore) Features() []state.Feature

Features returns the features available in this state store.

func (*SQLiteStore) Get

Get returns an entity from store.

func (SQLiteStore) GetComponentMetadata

func (s SQLiteStore) GetComponentMetadata() (metadataInfo metadata.MetadataMap)

func (*SQLiteStore) GetDBAccess added in v1.11.0

func (s *SQLiteStore) GetDBAccess() *sqliteDBAccess

Returns the dbaccess property. This method is used in tests.

func (*SQLiteStore) Init

func (s *SQLiteStore) Init(ctx context.Context, metadata state.Metadata) error

Init initializes the Sql server state store.

func (*SQLiteStore) Multi

Multi handles multiple transactions. Implements TransactionalStore.

func (*SQLiteStore) Ping

func (s *SQLiteStore) Ping(ctx context.Context) error

func (*SQLiteStore) Set

func (s *SQLiteStore) Set(ctx context.Context, req *state.SetRequest) error

Set adds/updates an entity on store.

Jump to

Keyboard shortcuts

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