sqlitedriver

package
v0.0.0-...-adf39d2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountsInitDbQueries

func AccountsInitDbQueries(q db.Queryable) (*accountsDbQueries, error)

AccountsInitDbQueries constructs an AccountsReader backed by sql queries.

func AccountsInitLightTest

func AccountsInitLightTest(tb testing.TB, e db.Executable, initAccounts map[basics.Address]basics.AccountData, proto config.ConsensusParams) (newDatabase bool, err error)

AccountsInitLightTest initializes an empty database for testing without the extra methods being called. implements Testing interface, test function only

func AccountsInitTest

func AccountsInitTest(tb testing.TB, e db.Executable, initAccounts map[basics.Address]basics.AccountData, proto protocol.ConsensusVersion) (newDatabase bool)

AccountsInitTest initializes an empty database for testing. implements Testing interface, test function only

func AccountsUpdateSchemaTest

func AccountsUpdateSchemaTest(ctx context.Context, e db.Executable) (err error)

AccountsUpdateSchemaTest adds some empty tables for tests to work with a "v6" store.

func MakeAccountsSQLWriter

func MakeAccountsSQLWriter(e db.Executable, hasAccounts, hasResources, hasKvPairs, hasCreatables bool) (w *accountsSQLWriter, err error)

MakeAccountsSQLWriter constructs an AccountsWriter backed by sql queries.

func MakeCatchpointPendingHashesIterator

func MakeCatchpointPendingHashesIterator(hashCount int, q db.Queryable) *catchpointPendingHashesIterator

MakeCatchpointPendingHashesIterator create a pending hashes iterator that retrieves the hashes in the catchpointpendinghashes table.

func MakeEncodedAccoutsBatchIter

func MakeEncodedAccoutsBatchIter(q db.Queryable) *encodedAccountsBatchIter

MakeEncodedAccoutsBatchIter creates an empty accounts batch iterator.

func MakeKVsIter

func MakeKVsIter(ctx context.Context, q db.Queryable) (*kvsIter, error)

MakeKVsIter creates a KV iterator.

func MakeMerkleCommitter

func MakeMerkleCommitter(e db.Executable, staging bool) (mc *merkleCommitter, err error)

MakeMerkleCommitter creates a MerkleCommitter object that implements the merkletrie.Committer interface allowing storing and loading merkletrie pages from a sqlite database.

func MakeOnlineAccountsSQLWriter

func MakeOnlineAccountsSQLWriter(e db.Executable, hasAccounts bool) (w *onlineAccountsSQLWriter, err error)

MakeOnlineAccountsSQLWriter constructs an OnlineAccountsWriter backed by sql queries.

func MakeOrderedAccountsIter

func MakeOrderedAccountsIter(e db.Executable, accountCount int) *orderedAccountsIter

MakeOrderedAccountsIter creates an ordered account iterator. Note that due to implementation reasons, only a single iterator can be active at a time.

func MakeStateProofVerificationReader

func MakeStateProofVerificationReader(q db.Queryable) trackerdb.SpVerificationCtxReader

MakeStateProofVerificationReader returns SpVerificationCtxReader for accessing from outside of ledger

func MakeStore

func MakeStore(pair db.Pair) trackerdb.Store

MakeStore crates a tracker SQL db from sql db handle.

func NewAccountsSQLReader

func NewAccountsSQLReader(q db.Queryable) *accountsV2Reader

NewAccountsSQLReader creates an SQL reader

func NewAccountsSQLReaderWriter

func NewAccountsSQLReaderWriter(e db.Executable) *accountsV2ReaderWriter

NewAccountsSQLReaderWriter creates an SQL reader+writer

func NewCatchpointSQLReaderWriter

func NewCatchpointSQLReaderWriter(e db.Executable) *catchpointReaderWriter

NewCatchpointSQLReaderWriter creates a Catchpoint SQL reader+writer

func OnlineAccountsInitDbQueries

func OnlineAccountsInitDbQueries(r db.Queryable) (*onlineAccountsDbQueries, error)

OnlineAccountsInitDbQueries constructs an OnlineAccountsReader backed by sql queries.

func Open

func Open(dbFilename string, dbMem bool, log logging.Logger) (store trackerdb.Store, err error)

Open opens the sqlite database store

func OpenForTesting

func OpenForTesting(t testing.TB, inMemory bool) (trackerdb.Store, string)

OpenForTesting opens a sqlite db file for testing purposes. It set the logging to the test logger and uses a tmp directory associated to the test for the db. The test tmp direction is automatically cleaned up by the golang test framework.

func RunMigrations

func RunMigrations(ctx context.Context, e db.Executable, params trackerdb.Params, log logging.Logger, targetVersion int32) (mgr trackerdb.InitParams, err error)

RunMigrations initializes the accounts DB if needed and return current account round. as part of the initialization, it tests the current database schema version, and perform upgrade procedures to bring it up to the database schema supported by the binary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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