summaryrefslogtreecommitdiff
path: root/src/db.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2015-06-03 00:06:31 +0200
committerJoel Klinghed <the_jk@yahoo.com>2015-06-03 00:06:31 +0200
commit5bc49de682eec79f3dc8096c6812bee70fe2d496 (patch)
treefa9655c46dded940496719f4f547b36ab5eb6c89 /src/db.cc
parentfb659a41cfe5523c62fd6993acddab120ccb0758 (diff)
Make it simpler to use DB
Add DB::Transaction
Diffstat (limited to 'src/db.cc')
-rw-r--r--src/db.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/db.cc b/src/db.cc
index b1efc21..d1742ad 100644
--- a/src/db.cc
+++ b/src/db.cc
@@ -57,4 +57,17 @@ double DB::Value::d() const {
return data_.d;
}
+std::shared_ptr<DB::Snapshot> DB::select(
+ const std::string& table, const OrderBy& order_by) {
+ std::vector<OrderBy> order_by_vector(1, order_by);
+ return select(table, Condition(), order_by_vector);
+}
+
+std::shared_ptr<DB::Snapshot> DB::select(
+ const std::string& table, const Condition& condition,
+ const OrderBy& order_by) {
+ std::vector<OrderBy> order_by_vector(1, order_by);
+ return select(table, condition, order_by_vector);
+}
+
} // namespace stuff