1) Added extra check in qtLiteral method.

2) Fixed some escaping issues.
This commit is contained in:
Akshay Joshi
2023-07-12 15:26:19 +05:30
parent 940d190bc8
commit 45b1794941
3 changed files with 5 additions and 7 deletions

View File

@@ -279,7 +279,8 @@ class Driver(BaseDriver):
if conn:
try:
if type(conn) != psycopg.Connection:
if type(conn) != psycopg.Connection and \
type(conn) != psycopg.AsyncConnection:
conn = conn.conn
res = psycopg.sql.Literal(value).as_string(conn).strip()
except Exception: