From 5e3add0b81d8923d6c72dd649c1829ea57f4f5f1 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Thu, 24 May 2018 15:21:38 -0700 Subject: [PATCH] docstring --- lemur/database.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemur/database.py b/lemur/database.py index 13e67710..8efd4b95 100644 --- a/lemur/database.py +++ b/lemur/database.py @@ -268,6 +268,11 @@ def clone(model): def get_count(q): + """ + Count the number of rows in a table. More efficient than count(*) + :param q: + :return: + """ count_q = q.statement.with_only_columns([func.count()]).order_by(None) count = q.session.execute(count_q).scalar() return count