From c03e2bf950e95d3424c3616a063e108ae8664c62 Mon Sep 17 00:00:00 2001 From: prasad83 Date: Tue, 2 May 2023 20:13:38 +0530 Subject: [PATCH] Fixed query execute with params for Sqlachemy 2.0 Sqlachemy 2.x expects parameters be bound to statement (=text(query)) --- records.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/records.py b/records.py index 1fd6a93..2f83e54 100644 --- a/records.py +++ b/records.py @@ -357,7 +357,7 @@ class Connection(object): """ # Execute the given query. - cursor = self._conn.execute(text(query), **params) # TODO: PARAMS GO HERE + cursor = self._conn.execute(text(query).bindparams(**params)) # TODO: PARAMS GO HERE # Row-by-row Record generator. row_gen = (Record(cursor.keys(), row) for row in cursor)