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