From 18a040773c389de7be48111efc0f3cf7252ffc68 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov 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::employer.is_null (). --- common/view/driver.cxx | 8 +++----- common/view/test.hxx | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'common/view') diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 8450b34..847d21b 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -505,8 +505,8 @@ main (int argc, char* argv[]) { result r (db->query ( - query::measures::weight > 60 && - query::measures::hight < 190)); + query::measures.weight > 60 && + query::measures.hight < 190)); result::iterator i (r.begin ()); @@ -535,9 +535,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); { - result r (db->query ( - query::measures::weight > 60 && - query::measures::hight < 190)); + result r (db->query ()); result::iterator i (r.begin ()); diff --git a/common/view/test.hxx b/common/view/test.hxx index 3ba6745..dc3439c 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -382,7 +382,9 @@ struct view10 // // Composite in object. // -#pragma db view object(person) query((?) + "ORDER BY" + person::age) +#pragma db view object(person) \ + query((person::measures.weight > 60 && person::measures.hight < 190) \ + + "ORDER BY" + person::age) struct view11 { std::string last_name; -- cgit v1.1