Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Query read methods need to take kwargs #169

Closed Jaymon closed 7 months ago

Jaymon commented 1 year ago

This doesn't work:

with FooOrm.transaction() as conn:
     FooOrm.query.one(connection=conn)

Because .one doesn't take kwargs so you can't pass connection to it.

Implementing this will actually be harder than it looks since most of the read methods just create an iterator and they don't actually make the query until you start iterating or whatnot, so there might need to be some rethinking on how this is done, like creating the cursor and passing the cursor into the iterator or something like that.