 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_WALLET_SQLITE_H
6 #define BITCOIN_WALLET_SQLITE_H
45 void Close()
override;
72 SQLiteDatabase(const
fs::path& dir_path, const
fs::path& file_path,
bool mock = false);
82 void Close() override;
89 bool Rewrite(
const char* skip =
nullptr)
override;
93 bool Backup(
const std::string& dest)
const override;
110 std::string
Format()
override {
return "sqlite"; }
113 std::unique_ptr<DatabaseBatch>
MakeBatch(
bool flush_on_close =
true)
override;
123 #endif // BITCOIN_WALLET_SQLITE_H
An instance of this class represents one database.
std::string Format() override
SQLiteDatabase & m_database
bool HasKey(CDataStream &&key) override
An instance of this class represents one SQLite3 database.
void IncrementUpdateCounter() override
void SetupSQLStatements()
RAII class that provides access to a WalletDatabase.
bool StartCursor() override
void ReloadDbEnv() override
RAII class that provides access to a WalletDatabase.
sqlite3_stmt * m_cursor_stmt
sqlite3_stmt * m_read_stmt
void Open() override
Open the database if it is not already opened.
bool PeriodicFlush() override
void RemoveRef() override
Indicate that database user has stopped using the database and that it could be flushed or closed.
bool EraseKey(CDataStream &&key) override
std::string SQLiteDatabaseVersion()
std::unique_ptr< DatabaseBatch > MakeBatch(bool flush_on_close=true) override
Make a SQLiteBatch connected to this database.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
sqlite3_stmt * m_delete_stmt
const std::string m_dir_path
std::string Filename() override
Return path to main database file for logs and error messages.
std::atomic< unsigned int > nUpdateCounter
void Flush() override
No-ops.
bool Rewrite(const char *skip=nullptr) override
Rewrite the entire database on disk.
sqlite3_stmt * m_overwrite_stmt
bool ReadKey(CDataStream &&key, CDataStream &value) override
sqlite3_stmt * m_insert_stmt
bool WriteKey(CDataStream &&key, CDataStream &&value, bool overwrite=true) override
void AddRef() override
Indicate the a new database user has began using the database.
void CloseCursor() override
Filesystem operations and types.
bool Backup(const std::string &dest) const override
Back up the entire database to a file.
std::unique_ptr< SQLiteDatabase > MakeSQLiteDatabase(const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
Double ended buffer combining vector and stream-like interfaces.
bool error(const char *fmt, const Args &... args)
bool ReadAtCursor(CDataStream &key, CDataStream &value, bool &complete) override
void Close() override
Close the database.
const std::string m_file_path
bool Verify(bilingual_str &error)
bool TxnCommit() override
SQLiteBatch(SQLiteDatabase &database)