Replies: 1 comment
-
I've found a workaround! Instead of passing import psycopg
from psycopg.rows import dict_row, DictRow, TupleRow
def create_psycopg_connection() -> psycopg.Connection[TupleRow]:
return psycopg.connect(
host="",
port="",
user="",
password="",
database="",
)
connection = create_psycopg_connection()
cursor: psycopg.Cursor[DictRow] = connection.cursor(row_factory=dict_row) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm using the latest Pyright and the latest psycopg and I'm getting errors for my code. How can I make my code Pyright-compatible, or how can be psycopg made Pyright-compatible in this case? Basically I need my rows to be dicts rather than the default tuples.
Errors:
Versions:
pyright 1.1.372
psycopg==3.2.1
psycopg-binary==3.2.1
(All the latest stable)
Similar problem:
psycopg/psycopg#865
Beta Was this translation helpful? Give feedback.
All reactions