From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/db/
Date: Mon, 26 Jun 2023 21:52:28 +0000 (UTC) [thread overview]
Message-ID: <1687816147.73e8b3e7c00b1b2686ae0df6d406181b6c3808a7.zorry@gentoo> (raw)
commit: 73e8b3e7c00b1b2686ae0df6d406181b6c3808a7
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 26 21:49:07 2023 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Mon Jun 26 21:49:07 2023 +0000
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=73e8b3e7
Add support to remove ebuilds in db
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
buildbot_gentoo_ci/db/versions.py | 40 +++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/buildbot_gentoo_ci/db/versions.py b/buildbot_gentoo_ci/db/versions.py
index 6b534f3..0aaac1b 100644
--- a/buildbot_gentoo_ci/db/versions.py
+++ b/buildbot_gentoo_ci/db/versions.py
@@ -131,6 +131,46 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
res = yield self.db.pool.do(thd)
return res
+ @defer.inlineCallbacks
+ def getEbuildsByPackage(self, p_uuid, deleted=False):
+ def thd(conn):
+ tbl = self.db.model.versions
+ q = tbl.select()
+ q = q.where(tbl.c.deleted == deleted)
+ q = q.where(tbl.c.package_uuid == p_uuid)
+ return [self._row2dict(conn, row)
+ for row in conn.execute(q).fetchall()]
+ res = yield self.db.pool.do(thd)
+ return res
+
+ @defer.inlineCallbacks
+ def removeVersion(self, uuid):
+ def thd(conn, no_recurse=False):
+ tbl = self.db.model.versions
+ q = tbl.delete()
+ q = q.where(tbl.c.uuid == uuid)
+ conn.execute(q)
+ yield self.db.pool.do(thd)
+
+ @defer.inlineCallbacks
+ def removeVersionMetadata(self, version_uuid):
+ def thd(conn, no_recurse=False):
+ tbl = self.db.model.versions_metadata
+ q = tbl.delete()
+ q = q.where(tbl.c.version_uuid == version_uuid)
+ conn.execute(q)
+ yield self.db.pool.do(thd)
+
+ @defer.inlineCallbacks
+ def removeVersionKeyword(self, version_uuid):
+ def thd(conn, no_recurse=False):
+ tbl = self.db.model.versions_keywords
+ q = tbl.delete()
+ q = q.where(tbl.c.version_uuid == version_uuid)
+ conn.execute(q)
+ yield self.db.pool.do(thd)
+
+
def _row2dict(self, conn, row):
return dict(
uuid=row.uuid,
next reply other threads:[~2023-06-26 21:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 21:52 Magnus Granberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-30 21:44 [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/db/ Magnus Granberg
2023-05-28 9:49 Magnus Granberg
2023-03-10 22:36 Magnus Granberg
2022-10-03 1:20 Magnus Granberg
2022-08-22 22:54 Magnus Granberg
2022-07-28 11:31 Magnus Granberg
2021-03-18 23:18 Magnus Granberg
2021-01-10 21:41 Magnus Granberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1687816147.73e8b3e7c00b1b2686ae0df6d406181b6c3808a7.zorry@gentoo \
--to=zorry@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox