Im using psycopg3 and would like to see what the actual sql with the parameters is so i can execute it using dbweaver…
with psycopg.connect(self.connect_str, autocommit=True) as conn:
if self.log.level == logging.DEBUG:
cur = conn.cursor()
sql_mogr = cur.mogrify(sql, params)
self.log.debug(sql_mogr)
else:
self.log.info(f'sql: {sql}, params:{params}')
df = pd.read_sql(sql, con = conn, params = params)
The results of the mogrify line is:
AttributeError: 'Cursor' object has no attribute 'mogrify'
Does psycopg3 not support this method? if not, what is an alternate solution?