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;
120 #endif // BITCOIN_WALLET_SQLITE_H
void CloseCursor() override
bool TxnCommit() override
bool Backup(const std::string &dest) const override
Back up the entire database to a file.
std::string Filename() override
Return path to main database file for logs and error messages.
bool WriteKey(CDataStream &&key, CDataStream &&value, bool overwrite=true) override
void Flush() override
No-ops.
bool Rewrite(const char *skip=nullptr) override
Rewrite the entire database on disk.
Double ended buffer combining vector and stream-like interfaces.
void SetupSQLStatements()
void Open() override
Open the database if it is not already opened.
bool EraseKey(CDataStream &&key) override
std::string SQLiteDatabaseVersion()
sqlite3_stmt * m_read_stmt
void ReloadDbEnv() override
sqlite3_stmt * m_overwrite_stmt
void IncrementUpdateCounter() override
std::string Format() override
RAII class that provides access to a WalletDatabase.
const std::string m_dir_path
bool HasKey(CDataStream &&key) override
bool ReadAtCursor(CDataStream &key, CDataStream &value, bool &complete) override
void AddRef() override
Indicate the a new database user has began using the database.
An instance of this class represents one SQLite3 database.
bool StartCursor() override
SQLiteDatabase & m_database
std::unique_ptr< SQLiteDatabase > MakeSQLiteDatabase(const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
bool PeriodicFlush() override
const std::string m_file_path
bool Verify(bilingual_str &error)
std::atomic< unsigned int > nUpdateCounter
sqlite3_stmt * m_cursor_stmt
SQLiteBatch(SQLiteDatabase &database)
sqlite3_stmt * m_delete_stmt
void Close() override
Close the database.
RAII class that provides access to a WalletDatabase.
bool ReadKey(CDataStream &&key, CDataStream &value) override
std::unique_ptr< DatabaseBatch > MakeBatch(bool flush_on_close=true) override
Make a SQLiteBatch connected to this database.
bool error(const char *fmt, const Args &... args)
void RemoveRef() override
Indicate that database user has stopped using the database and that it could be flushed or closed...
sqlite3_stmt * m_insert_stmt
An instance of this class represents one database.