Andrew Chow
f023b7cac0
wallet: Enforce sqlite serialized threading mode
2020-10-14 11:28:18 -04:00
Andrew Chow
6173269866
Set and check the sqlite user version
2020-10-14 11:28:18 -04:00
Andrew Chow
9d3d2d263c
Use network magic as sqlite wallet application ID
2020-10-14 11:28:18 -04:00
Andrew Chow
ac38a87225
Determine wallet file type based on file magic
2020-10-14 11:28:18 -04:00
Andrew Chow
6045f77003
Implement SQLiteDatabase::MakeBatch
2020-10-14 11:28:18 -04:00
Andrew Chow
727e6b2a4e
Implement SQLiteDatabase::Verify
2020-10-14 11:28:18 -04:00
Andrew Chow
b4df8fdb19
Implement SQLiteDatabase::Rewrite
...
Rewrite uses the VACUUM command which does exactly what we want. A
specific advertised use case is to compact a database and ensure that
any deleted data is actually deleted.
2020-10-14 11:28:18 -04:00
Andrew Chow
010e365906
Implement SQLiteDatabase::TxnBegin, TxnCommit, and TxnAbort
2020-10-14 11:28:18 -04:00
Andrew Chow
ac5c1617e7
Implement SQLiteDatabase::Backup
2020-10-14 11:28:18 -04:00
Andrew Chow
f6f9cd6a64
Implement SQLiteBatch::StartCursor, ReadAtCursor, and CloseCursor
2020-10-14 11:28:18 -04:00
Andrew Chow
bf90e033f4
Implement SQLiteBatch::ReadKey, WriteKey, EraseKey, and HasKey
2020-10-14 11:28:18 -04:00
Andrew Chow
7aa45620e2
Add SetupSQLStatements
2020-10-14 11:28:18 -04:00
Andrew Chow
6636a2608a
Implement SQLiteBatch::Close
2020-10-14 11:28:18 -04:00
Andrew Chow
93825352a3
Implement SQLiteDatabase::Close
2020-10-14 11:28:18 -04:00
Andrew Chow
a0de83372b
Implement SQLiteDatabase::Open
2020-10-14 11:28:18 -04:00
Andrew Chow
3bfa0fe125
Initialize and Shutdown sqlite3 globals
...
sqlite3 recommends that sqlite3_initialize be called when the
application starts, and sqlite3_shutdown when it stops. Since we don't
always use sqlite3, we initialize it when a SQLiteDatabse is constructed
(calling sqlite3_initialize after initialized is a no-op). We call
sqlite3_shutdown when we see that there are no databases opened. The
number of open databases is tracked by an atomic g_dbs_open.
2020-10-14 11:28:18 -04:00
Andrew Chow
5a488b3d77
Constructors, destructors, and relevant private fields for SQLiteDatabase/Batch
2020-10-14 11:28:17 -04:00
Andrew Chow
ca8b7e04ab
Implement SQLiteDatabaseVersion
2020-10-14 11:27:40 -04:00
Andrew Chow
7577b6e1c8
Add SQLiteDatabase and SQLiteBatch dummy classes
2020-10-14 11:27:37 -04:00