From e19823383d7425ce4ee4260540bed0678f2ebaf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 13 Jun 2024 04:01:19 +0200 Subject: [PATCH] Mark SQL query with `sqlalchemy.text()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- datagrepper/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datagrepper/app.py b/datagrepper/app.py index b176947e..74f9c268 100644 --- a/datagrepper/app.py +++ b/datagrepper/app.py @@ -213,7 +213,7 @@ def count_all_messages(): """ if app.config.get("DATAGREPPER_APPROXIMATE_COUNT"): - query = "SELECT * FROM approximate_row_count('messages');" + query = sqlalchemy.text("SELECT * FROM approximate_row_count('messages');") total = dm.session.execute(query).first()[0] else: total = dm.Message.grep(defer=True)[0]