aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-10 17:05:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-10 17:05:37 +0200
commit466dbfe2a99cd40c0d60e00ed5f05c862a8b41b1 (patch)
treee3646930581a00df9b818bffda4021f9a4472578
parent9ed005a6000008b8e84d98a52407a0ab8cb412d0 (diff)
Test ability to load result into an existing object
-rw-r--r--common/query/driver.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index bcfbff1..9a8300a 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -82,7 +82,14 @@ main (int argc, char* argv[])
{
transaction t (db->begin_transaction ());
result<person> r (db->query<person> ());
- print (r);
+
+ for (result<person>::iterator i (r.begin ()); i != r.end (); ++i)
+ {
+ person p;
+ i.load (p);
+ cout << p << endl;
+ }
+
t.commit ();
}