diff options
Diffstat (limited to 'src/wallet_sqlite.h')
| -rw-r--r-- | src/wallet_sqlite.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/wallet_sqlite.h b/src/wallet_sqlite.h new file mode 100644 index 0000000..9812d3a --- /dev/null +++ b/src/wallet_sqlite.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | // Copyright (c) 2026 Bitflash developers | ||
| 2 | // Distributed under the MIT/X11 software license. | ||
| 3 | |||
| 4 | #ifndef BITFLASH_WALLET_SQLITE_H | ||
| 5 | #define BITFLASH_WALLET_SQLITE_H | ||
| 6 | |||
| 7 | #include <sqlite3.h> | ||
| 8 | |||
| 9 | class CWalletDBSQLite | ||
| 10 | { | ||
| 11 | public: | ||
| 12 | CWalletDBSQLite(); | ||
| 13 | ~CWalletDBSQLite(); | ||
| 14 | |||
| 15 | bool Open(const string& strPath, string& strError); | ||
| 16 | void Close(); | ||
| 17 | |||
| 18 | bool BeginTransaction(string& strError); | ||
| 19 | bool CommitTransaction(string& strError); | ||
| 20 | bool RollbackTransaction(string& strError); | ||
| 21 | |||
| 22 | bool WriteRecord(const vector<unsigned char>& vchKey, | ||
| 23 | const vector<unsigned char>& vchValue, | ||
| 24 | string& strError); | ||
| 25 | bool ReadRecord(const vector<unsigned char>& vchKey, | ||
| 26 | vector<unsigned char>& vchValueRet, | ||
| 27 | string& strError); | ||
| 28 | bool CountRecords(int& nRecordsRet, string& strError); | ||
| 29 | |||
| 30 | private: | ||
| 31 | sqlite3* pdb; | ||
| 32 | |||
| 33 | bool Exec(const char* pszSql, string& strError); | ||
| 34 | bool InitSchema(string& strError); | ||
| 35 | |||
| 36 | CWalletDBSQLite(const CWalletDBSQLite&); | ||
| 37 | void operator=(const CWalletDBSQLite&); | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif | ||