Creating a SQLAlchemy Session from aiomysql

600 views
Skip to first unread message

ceppi...@gmail.com

unread,
Jun 2, 2017, 4:33:28 PM6/2/17
to aio-libs
I've been trying to get sessionmaker and the syntax that goes with it working in aiomysql. However, I can't seem to get a working example. Here's a condensed snippet of the aiohttp/aiomysql project:


I have tried acquiring a connection from the aiomysql engine and passing that to sessionmaker, I've tried passing the engine directly, and several other derivatives. I'm hoping not to rewrite all my declarative SA class objects, is there a way consume the SA session? 

Thanks,
Marco Ceppi

Nickolai Novik

unread,
Jun 2, 2017, 4:46:57 PM6/2/17
to ceppi...@gmail.com, aio-libs
Sorry, aiopg.sa/aiomysql.sa do not support sessionmaker and rest of ORM features. SQLA used more as query builder.

--
You received this message because you are subscribed to the Google Groups "aio-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aio-libs+u...@googlegroups.com.
To post to this group, send email to aio-...@googlegroups.com.
Visit this group at https://groups.google.com/group/aio-libs.
To view this discussion on the web visit https://groups.google.com/d/msgid/aio-libs/b80cfa86-15ba-475e-934a-dbdaf9b46c0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ceppi...@gmail.com

unread,
Jun 2, 2017, 4:53:14 PM6/2/17
to aio-libs, ceppi...@gmail.com
Thanks, that's unfortunate. Are there any plans to support this in the project?

Nickolai Novik

unread,
Jun 2, 2017, 5:03:59 PM6/2/17
to ceppi...@gmail.com, aio-libs
Not sure if it is even possible, SQLA ORM inherently synchronous.

Reply all
Reply to author
Forward
0 new messages