unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob d0cdf9e5a790dc9d018a48df2fa48e7f61966d48 819 bytes (raw)
name: packages/patches/gourmet-sqlalchemy-compat.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
diff --git a/gourmet/backends/db.py b/gourmet/backends/db.py
index faa6a57a..7e6d2bc6 100644
--- a/gourmet/backends/db.py
+++ b/gourmet/backends/db.py
@@ -773,9 +773,11 @@ class RecData (Pluggable):
         """Return the number of rows in table that match criteria
         """
         if criteria:
-            return table.count(*make_simple_select_arg(criteria,table)).execute().fetchone()[0]
+            return sqlalchemy.select(
+                sqlalchemy.func.count(criteria)).select_from(table).scalar()
         else:
-            return table.count().execute().fetchone()[0]
+            return sqlalchemy.select(
+                sqlalchemy.func.count()).select_from(table).scalar()
 
     def fetch_join (self, table1, table2, col1, col2,
                     column_names=None, sort_by=[], **criteria):

debug log:

solving d0cdf9e5a790dc9d018a48df2fa48e7f61966d48 ...
found d0cdf9e5a790dc9d018a48df2fa48e7f61966d48 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).