orator icon indicating copy to clipboard operation
orator copied to clipboard

asyncio support

Open Gr1N opened this issue 9 years ago • 10 comments
trafficstars

Hi!

Thanks for your work guys, ORM looks very nice to me (good replacement for SQLAlchemy to my mind).

But my question about asyncio support (or your plans to support if any), I found nothing in docs, but maybe I wrong. It would be great to have possibility to write code like this (https://github.com/aio-libs/aiopg#example-of-sqlalchemy-optional-integration) using orator.

Gr1N avatar Oct 24 '16 16:10 Gr1N

Thanks for your interest in Orator!

Orator does not currently support asyncio but that's definitely something I want to do.

I don't know just yet if it will be directly integrated in the library or available as a separate package.

sdispater avatar Oct 24 '16 16:10 sdispater

Nice to hear this!

I know this is weird question, but maybe you have any estimates (like half year, year...)?

Gr1N avatar Oct 24 '16 16:10 Gr1N

I see that aiopg mentioned, but there is better option asyncpg

MechanisM avatar Oct 24 '16 19:10 MechanisM

@Gr1N No, I don't have any estimates yet.

sdispater avatar Oct 27 '16 20:10 sdispater

Nice to hear this. I think separate package would be better, like https://github.com/challengepost/activeasync

jychen7 avatar May 02 '17 02:05 jychen7

Great idea wondering if there's been any recent developments/thoughts on this, definitely interested in hearing/joining/starting the discussion

mitchfriedman avatar Nov 15 '18 04:11 mitchfriedman

Same here, just trying out the library coming from a Peewee background and wondering if there are any plans to make Orator asynchronous

JosXa avatar Nov 22 '18 22:11 JosXa

@mitchfriedman @JosXa Out of curiosity and as someone not familiar with exactly what parts would be asyncio, what are you thinking to make asynchronous? Is it just saving models asynchronously?

josephmancuso avatar Nov 23 '18 14:11 josephmancuso

I'm not sure exactly what is needed to be changed to make this compatible with asyncio, but yeah, all IO operations (in this case, not just saving, but all calls to the DB - connection creation/resume/termination, all queries, etc) need to yield execution to the event loop.

mitchfriedman avatar Nov 26 '18 19:11 mitchfriedman

I agree in making it a seperate package and to simplify the async, you can use Trio and it's postgres library trioppg.

mrcartoonster avatar Nov 15 '20 04:11 mrcartoonster