aboutsummaryrefslogtreecommitdiff
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):
patch?id=013086c3dbaa2e28dd1b3c21a7ebe51ac829a1eb'>gnu: Add perl-5.14....* gnu/packages/patches/perl-5.14-autosplit-default-time.patch, gnu/packages/patches/perl-5.14-module-pluggable-search.patch, gnu/packages/patches/perl-5.14-no-sys-dirs.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/perl.scm (perl-5.14): New variable. Ricardo Wurmus