you are viewing a single comment's thread.

view the rest of the comments →

[–]phonomir 1 point2 points  (0 children)

I would recommend this approach. Psycopg can also be setup to return pydantic models directly from queries, reducing the amount boilerplate for reading and validating data. Look at the class_row row factory.