aboutsummaryrefslogtreecommitdiff
path: root/mod/ci-common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-10-24 14:45:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-10-24 14:45:19 +0200
commit1bfb0c463d49e939dabc71fbb6adbc154915e619 (patch)
tree3d61531d5e9eedf7bf253c43e25567391c4d7fe2 /mod/ci-common.cxx
parent7728e2469fdf49307231d57a9fc5a2cf60aa535a (diff)
Sketch
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;
+ }
}