You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import psycopg
from psycopg import sql
# Example table name
table_name = "my_table"
# Quoting an identifier
quoted_identifier = sql.Identifier(table_name)
# Using the quoted identifier in a query
query = sql.SQL("SELECT * FROM {}").format(quoted_identifier)
# Connect to the database (using psycopg3)
with psycopg.connect("dbname=test user=postgres") as conn:
with conn.cursor() as cur:
cur.execute(query)
result = cur.fetchall()
print(result)
Not sure whether that's easy to support, but I'd at least make the import quote_ident not fatal.
From a quick test, django_sql_dashboard seems to work fine with psycopg3 as well, if that were to be changed.
The text was updated successfully, but these errors were encountered:
django_sql_dashboard fails with psycopg3 because of ModuleNotFoundError:
./django_sql_dashboard/views.py:from psycopg2.extensions import quote_ident
I take it this is a reexport?
In psycopg3 that would be something like this:
Not sure whether that's easy to support, but I'd at least make the import quote_ident not fatal.
From a quick test, django_sql_dashboard seems to work fine with psycopg3 as well, if that were to be changed.
The text was updated successfully, but these errors were encountered: