3 ms·
I remember seeing aiosql a bit back and being impressed. I'll give that a shot. Right now I have a Flask application with separate dataclass models where I wri
by jjice 5y ago
I remember seeing aiosql a bit back and being impressed. I'll give that a shot.
Right now I have a Flask application with separate dataclass models where I write a function like `get_by_id` and then then query the DB and get a dict back (using psycopg2 with DictRow returns) and then I can pass that directly to the dataclass constructor with `User(**row)`. Very flexible and working really well so far. Not sure how this scales though, but I'm happy with it at the moment.