From 18a040773c389de7be48111efc0f3cf7252ffc68 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Tue, 20 Sep 2011 11:53:04 +0200
Subject: Change query syntax to use . for composite and -> for object pointer
 access

Also make non-inverse query columns act as both an object pointer and a
normal column. The latter allows us to use natural expressions such as
query<employee>::employer.is_null ().
---
 common/erase-query/driver.cxx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'common/erase-query')

diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx
index 2137377..5085207 100644
--- a/common/erase-query/driver.cxx
+++ b/common/erase-query/driver.cxx
@@ -112,6 +112,31 @@ main (int argc, char* argv[])
     }
     */
 
+    // For now we can only do column-based tests, like is_null().
+    //
+    {
+      object o11 (1);
+      object o12 (2);
+      object o13 (3);
+      object2 o2;
+
+      o12.o2 = &o2;
+
+      transaction t (db->begin ());
+      db->persist (o2);
+      db->persist (o13);
+      db->persist (o12);
+      db->persist (o11);
+      t.commit ();
+    }
+
+    {
+      transaction t (db->begin ());
+      assert (db->erase_query<object> (query::o2.is_null ()) == 2);
+      db->erase_query<object> ();
+      t.commit ();
+    }
+
     // Make sure container data is deleted.
     //
     {
-- 
cgit v1.1