wallet::SQLiteDatabase

An instance of this class represents one SQLite3 database.

Synopsis

Declared in <wallet/sqlite.h>

class SQLiteDatabase
    : public WalletDatabase

Base Classes

NameDescription
WalletDatabaseAn instance of this class represents one database.

Member Functions

NameDescription
SQLiteDatabase [constructor]Constructors
~SQLiteDatabase [destructor] [virtual]Destroy the handle and clean up the SQLite connection.
Backup Back up the entire database to a file.
Close [virtual]Close the database
Filename [virtual]Return the name of the database file.
Files [virtual]Return paths to all database created files
Format [virtual]Return the name of this database's storage format.
HasActiveTxn Return true if there is an on-going txn in this connection
MakeBatch [virtual]Make a SQLiteBatch connected to this database
Open [virtual]Open the database if it is not already opened
Rewrite [virtual]Rewrite the entire database on disk
Verify Check the integrity of the database.

Data Members

NameDescription
m_db The underlying SQLite database connection.
m_refcount Counts the number of active database users to be sure that the database is not closed while someone is using it
m_use_unsafe_sync Whether to use unsafe synchronous settings for faster, less durable writes.
m_write_semaphore Semaphore ensuring only one batch writes to the database at a time.

Protected Member Functions

NameDescription
SQLiteDatabase [constructor]Construct a database handle with extra SQLite open flags.

Friends

NameDescription
wallet::SQLiteBatchRAII class that provides access to a WalletDatabase

Non-Member Functions

NameDescription
MakeSQLiteDatabaseOpen or create a SQLite wallet database at the given path.
RunWithinTxnExecutes the provided function 'func' within a database transaction context.

Derived Classes

NameDescription
InMemoryWalletDatabase An in-memory SQLiteDatabase. Used as a temporary build artifact where no on-disk persistence is needed.