package
4.0.2-stable+incompatible
Repository: https://github.com/algorand/go-algorand.git
Documentation: pkg.go.dev
# Functions
GetUserVersion returns the user version field stored in the sqlite database if the database was never initiliazed with a version, it would return 0 as the version.
Initialize creates or upgrades a DB accessor in a new atomic context.
InitializeWithContext creates or upgrades a DB accessor.
IsErrBusy examine the input inerr variable of type error and determine if it's a sqlite3 error for the ErrBusy error code.
LoggedRetry executes a function repeatedly as long as it returns an error that indicates database contention that warrants a retry.
MakeAccessor creates a new Accessor.
MakeErasableAccessor creates a new Accessor with the secure_delete pragma set; see https://www.sqlite.org/pragma.html#pragma_secure_delete It is not read-only and not in-memory (otherwise, erasability doesn't matter).
MakeErrUnknownVersion makes an ErrUnknownVersion.
MakeErrUpgradeFailure makes an ErrUpgradeFailure.
OpenErasablePair opens the filename with both reading and writing accessors with the secure_delete pragma set, using MakeErasableAccessor.
OpenPair opens the filename with both reading and writing accessors.
ResetTransactionWarnDeadline allow the atomic function to extend its warn deadline by setting a new deadline.
Retry executes a function repeatedly as long as it returns an error that indicates database contention that warrants a retry.
SetUserVersion sets the userVersion as the new user version, and return the old version.
URI returns the sqlite URI given a db filename as an input.
# Constants
SynchronousModeExtra synchronous is like FULL with the addition that the directory containing a rollback journal is synced after that journal is unlinked to commit a transaction in DELETE mode.
SynchronousModeFull (2), the SQLite database engine will use the xSync method of the VFS to ensure that all content is safely written to the disk surface prior to continuing.
SynchronousModeNormal (1), the SQLite database engine will still sync at the most critical moments, but less often than in FULL mode.
SynchronousModeOff (0), SQLite continues without syncing as soon as it has handed data off to the operating system.
# Variables
ErrNoOpMigration is returned when there was no work for the migration to perform.
ErrUnableToRead is returned when the accessor cannot be read.
# Structs
An Accessor manages a sqlite database handle and any outstanding batching operations.
ErrUnknownVersion is returned when a migration to the current version is not available.
ErrUpgradeFailure is returned when a migration returns an error.
Pair represents two accessors - read and write.
VacuumStats returns the database statistics before and after a vacuum operation.
# Interfaces
Executable is similar but has write methods as well.
Queryable is meant to represent the union of a transaction (sql.Tx) and the underlying database (sql.DB), so that code issuing a single read-only query can be run directly on the sql.DB object without creating a short-lived transaction for a single SELECT query.
# Type aliases
Migration is used to upgrade a database from one version to the next.
SynchronousMode is the syncronious modes supported by sqlite database.