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