Skip to content

Commit

Permalink
Mark SQL query with sqlalchemy.text()
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
  • Loading branch information
abompard committed Jun 13, 2024
1 parent 0109a69 commit e198233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datagrepper/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e198233

Please sign in to comment.