aboutsummaryrefslogtreecommitdiff
path: root/mod/ci-common.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/ci-common.cxx')
-rw-r--r--mod/ci-common.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx
index 11d55af..5b039ef 100644
--- a/mod/ci-common.cxx
+++ b/mod/ci-common.cxx
@@ -856,4 +856,30 @@ namespace brep
return s;
}
+
+ optional<tenant_service> ci_start::
+ find (odb::core::database& db,
+ const string& type,
+ const string& id) const
+ {
+ using namespace odb::core;
+
+ assert (!transaction::has_current ());
+
+ transaction tr (db.begin ());
+
+ using query = query<build_tenant>;
+
+ shared_ptr<build_tenant> t (
+ db.query_one<build_tenant> (query::service.id == id &&
+ query::service.type == type));
+
+ tr.commit ();
+
+ optional<tenant_service> r;
+ if (t != nullptr)
+ r = move (t->service);
+
+ return r;
+ }
}