diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-02 11:04:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-02 11:04:55 +0200 |
commit | 62ef9782b05e7edb8e391232c97c95a0dc9b34c3 (patch) | |
tree | 0a07be15d7b737ba62cb092e21cc453b146db1db /common/query/driver.cxx | |
parent | 15f718bbf874a77b1079a55f29335447aeba17dd (diff) |
Add result_iterator::id() function that returns id without loading object
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r-- | common/query/driver.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 45392b8..e019fe5 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -493,6 +493,20 @@ main (int argc, char* argv[]) t.commit (); } + + // Test iterator::id(). + // + cout << "test 017" << endl; + { + transaction t (db->begin ()); + result r (db->query<person> (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i.id () == 3); + + t.commit (); + } } catch (const odb::exception& e) { |