diff options
author | methodus <methodus@web.de> | 2012-10-28 22:11:36 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-28 22:11:36 +0100 |
commit | 9478cdc825981329f3f864f14d61f51ae1ac0ace (patch) | |
tree | 57ae794c41fe6ce964a54be295b98b48baf28c04 /tests | |
parent | 6dd746005c921dc2c49bf19a3524ea3bfb5e2d30 (diff) | |
download | vdr-plugin-upnp-9478cdc825981329f3f864f14d61f51ae1ac0ace.tar.gz vdr-plugin-upnp-9478cdc825981329f3f864f14d61f51ae1ac0ace.tar.bz2 |
Continued database wrapper
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_database.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_database.cpp b/tests/test_database.cpp index da11cb9..2aa12b3 100644 --- a/tests/test_database.cpp +++ b/tests/test_database.cpp @@ -6,6 +6,7 @@ */ #include <iostream> +#include <sstream> #include "../include/db/connection.h" int main(){ @@ -15,7 +16,22 @@ int main(){ connection.BeginTransaction(); - connection.RollbackTransaction(); + std::stringstream ss; + + ss << "CREATE TABLE details" + << "(" + << " `propertyID` INTEGER PRIMARY KEY," + << " `@id` TEXT " + << " REFERENCES metadata (`@id`) ON DELETE CASCADE ON UPDATE CASCADE," + << " `property` TEXT," + << " `value` TEXT" + << ")"; + + db::Statement statement = connection.Prepare(ss.str()); + + statement.Execute(); + + connection.CommitTransaction(); } catch (const db::SQLiteException& e){ std::cerr << "Exception: "<< e.what() << std::endl; |