Skip to content

Commit

Permalink
feat: remove pagination from queries that return one field
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder committed Jun 13, 2024
1 parent 3267645 commit 8cfdfa0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion insights/sources/rooms/usecases/query_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ def execute(
with get_cursor(db_name="chats") as cur:
query_exec = cur.execute(query, params)
query_results = dictfetchall(query_exec)
paginated_results = {"next": None, "previous": None, "results": query_results}
if operation in ["count", "avg"]:
paginated_results = query_results
else:
paginated_results = {
"next": None,
"previous": None,
"results": query_results,
}
return paginated_results # parser(paginated_results)

0 comments on commit 8cfdfa0

Please sign in to comment.