Fixed outdated code example in README

This commit is contained in:
Roland Bock
2013-10-01 07:05:12 +02:00
parent 2e7d5478f6
commit fd51066e70

View File

@@ -68,8 +68,8 @@ if (const auto& row = db.run(select(foo.name.as(cheese)).from(foo).where(foo.id
std::cerr << "found: " << row.cheese << std::endl;
}
// selecting exactly one row:
return db.run(select(count(foo.id)).from(foo))->count;
// selecting a single row with a single result:
return db.run(select(count(foo.id)).from(foo)).front().count;
Of course there are joins and subqueries, more functions, order_by, group_by etc.
These will be documented soon.