// Copyright (c) 2026 Bitflash developers // Distributed under the MIT/X11 software license. #ifndef BITFLASH_WALLET_SQLITE_H #define BITFLASH_WALLET_SQLITE_H #include class CWalletRecordVisitor; class CWalletDBSQLite { public: CWalletDBSQLite(); ~CWalletDBSQLite(); bool Open(const string& strPath, string& strError); void Close(); bool BeginTransaction(string& strError); bool CommitTransaction(string& strError); bool RollbackTransaction(string& strError); bool Checkpoint(string& strError); bool WriteRecord(const vector& vchKey, const vector& vchValue, string& strError); bool ReadRecord(const vector& vchKey, vector& vchValueRet, string& strError); bool ScanRecords(CWalletRecordVisitor& visitor, string& strError); bool CountRecords(int& nRecordsRet, string& strError); private: sqlite3* pdb; bool Exec(const char* pszSql, string& strError); bool InitSchema(string& strError); CWalletDBSQLite(const CWalletDBSQLite&); void operator=(const CWalletDBSQLite&); }; #endif