Re: [sqlalchemy] is it possible to create an ORM session with a db cursor?

2017-03-23 Thread Jonathan Vanasco
On Wednesday, March 22, 2017 at 7:04:24 PM UTC-4, Mike Bayer wrote: > > you'd need to patch some kind of fake DBAPI connection that returns this > cursor from the cursor() method. it would be ugly but if the cursor > behaves well it could work. you'd get session.connection() to get a >

Re: [sqlalchemy] is it possible to create an ORM session with a db cursor?

2017-03-22 Thread mike bayer
you'd need to patch some kind of fake DBAPI connection that returns this cursor from the cursor() method. it would be ugly but if the cursor behaves well it could work. you'd get session.connection() to get a sqlalchemy.engine.Connection, then patch your "fake" DBAPI connection into it as

[sqlalchemy] is it possible to create an ORM session with a db cursor?

2017-03-22 Thread Jonathan Vanasco
longshot, i know. We've got some legacy twisted code that does raw operations via a twisted.enterprise.adbapi connection pool with the psycopg2 driver. Other services in this deployment are configured to use SqlAlchemy for all operations - this is the legacy holdout. There are a few chunks