mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Blob example using an in-memory database
This commit is contained in:
parent
65ad65b40c
commit
44fde46e2a
8
TODO.txt
8
TODO.txt
@ -1,13 +1,8 @@
|
||||
Add a Changelog
|
||||
|
||||
C++11 explicit support
|
||||
|
||||
Update Doxygen Documentation, but remove it from the master branch
|
||||
Publish the Doxygen Documentation in the Github Pages (gh-pages branch)
|
||||
|
||||
Missing test/example in v0.5.0:
|
||||
- :memory: table
|
||||
|
||||
Missing features in v0.5.0:
|
||||
- bind a SQLITE_STATIC value (string/blob)
|
||||
- bind a dynamic value with zerocopy (unlike SQLITE_TRANSIENT) with custom deleter
|
||||
@ -17,8 +12,7 @@ Missing documentation in v0.5.0:
|
||||
- This wrapper is not thread safe : compare to the thread safety of the SQLite3 library
|
||||
|
||||
Advanced missing features:
|
||||
- :memory: : use the "zVfs" (last) parameter of sqlite3_open_v2() to give access to the ":memory:" VFS module
|
||||
- backup support to/from :memory:
|
||||
- backup support to/from file/:memory:
|
||||
- batch mode managing multiple queries semicolon separated ?
|
||||
- Function ?
|
||||
- Agregate ?
|
||||
|
@ -19,8 +19,6 @@ Database::Database(const char* apFilename, const int aFlags /*= SQLITE_OPEN_READ
|
||||
mpSQLite(NULL),
|
||||
mFilename(apFilename)
|
||||
{
|
||||
// TODO SRombauts : use the "zVfs" (last) parameter to give access to the ":memory:" VFS module
|
||||
// TODO SRombauts : then add a backup mode to/from ":memory:"
|
||||
int ret = sqlite3_open_v2(apFilename, &mpSQLite, aFlags, NULL);
|
||||
if (SQLITE_OK != ret)
|
||||
{
|
||||
|
@ -261,11 +261,11 @@ int main (void)
|
||||
remove("transaction.db3");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Binary blob example (6/6) :
|
||||
// Binary blob and in-memory database example (6/6) :
|
||||
try
|
||||
{
|
||||
// Open a database file in create/write mode
|
||||
SQLite::Database db("blob.db3", SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
|
||||
SQLite::Database db(":memory:", SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
|
||||
std::cout << "SQLite database file '" << db.getFilename().c_str() << "' opened successfully\n";
|
||||
|
||||
db.exec("DROP TABLE IF EXISTS test");
|
||||
@ -326,7 +326,6 @@ int main (void)
|
||||
std::cout << "SQLite exception: " << e.what() << std::endl;
|
||||
abort(); // unexpected error : abort the example program
|
||||
}
|
||||
remove("blob.db3");
|
||||
remove("out.png");
|
||||
|
||||
std::cout << "everything ok, quitting\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user