diff options
Diffstat (limited to 'tests/test_database.cpp')
-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; |