aboutsummaryrefslogtreecommitdiff
path: root/evolution/drop-column/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-16 07:07:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-17 12:04:03 +0200
commitb6ebd340651eaf347c86d3ba0dbed82c6cc8fb8d (patch)
tree78f43b3355d87424a000bb6f2ccd2a117f3affa7 /evolution/drop-column/driver.cxx
parentea176df42469417c37ad050616db23a01277b4e0 (diff)
Implement logical column drop for SQLite
Diffstat (limited to 'evolution/drop-column/driver.cxx')
-rw-r--r--evolution/drop-column/driver.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx
index 4078c58..6e72f7d 100644
--- a/evolution/drop-column/driver.cxx
+++ b/evolution/drop-column/driver.cxx
@@ -29,10 +29,6 @@ main (int argc, char* argv[])
try
{
auto_ptr<database> db (create_database (argc, argv, false));
-
- // SQLite doesn't support dropping of columns.
- //
-#ifndef DATABASE_SQLITE
bool embedded (schema_catalog::exists (*db));
// 1 - base version
@@ -60,9 +56,11 @@ main (int argc, char* argv[])
object o (1);
o.str = "abc";
o.num = 123;
+ o.ptr = new object1 (1, 2);
{
transaction t (db->begin ());
+ db->persist (*o.ptr);
db->persist (o);
t.commit ();
}
@@ -87,6 +85,7 @@ main (int argc, char* argv[])
assert (p->str == "abc");
assert (p->num == 123);
+ assert (p->ptr->id.x == 1 && p->ptr->id.y == 2);
t.commit ();
}
@@ -108,7 +107,8 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
auto_ptr<object> p (db->load<object> (1));
- assert (p->str == "");
+ assert (p->str == "" && p->ptr == 0);
+ db->erase<object1> (value (1, 2)); // SQLite logical delete test.
t.commit ();
}
break;
@@ -119,7 +119,6 @@ main (int argc, char* argv[])
return 1;
}
}
-#endif // DATABASE_SQLITE
}
catch (const odb::exception& e)
{