An instance of this class represents one SQLite3 database.

Synopsis

Declared in <wallet/sqlite.h>

class SQLiteDatabase
    : public WalletDatabase

Base Classes

Name

Description

WalletDatabase

An instance of this class represents one database.

Member Functions

Name

Description

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

Name

Description

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

Name

Description

SQLiteDatabase [constructor]

Construct a database handle with extra SQLite open flags.

Friends

Name

Description

wallet::SQLiteBatch

RAII class that provides access to a WalletDatabase

Non-Member Functions

Name

Description

MakeSQLiteDatabase

Open or create a SQLite wallet database at the given path.

RunWithinTxn

Executes the provided function 'func' within a database transaction context.

Derived Classes

Name

Description

InMemoryWalletDatabase

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

Created with MrDocs