-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibly use SQLAlchemy Strategies #45
Comments
Thank you for link to very interesting project. I need to dig into alchimia code before making answer. |
Of course! I could be totally wrong too and the strategy thing might not be useful at all, but figured I'd mention it in case it was useful. |
@dstufft interesting point As far as I can see: But I think it would be interesting to add from sqlalchemy import engine
from aiopg import AIOPG_STRATEGY
@asyncio.coroutine
def go()
engine = yield from create_engine(host, port, strategy=AIOPG_STRATEGY ) in this case |
@jettify You can't mix simple function call, generator and |
@eirnym My point was not to rewrite But now I do not think this is good idea any more. |
I created a strategy for asyncio at https://github.com/RazerM/sqlalchemy_aio, based on alchimia. |
It looks like the
aiopg.sa
module relies on reimplementing some of the lower level parts of SQLAlchemy and providing alternatives which use a similar API. I wonder if this could instead be done using SQLAlchemy's support for different execution strategies?There is an example of doing this for Twisted at https://github.com/alex/alchimia, that defers things to a thread pool, largely because it wants to work for any database not just PostgreSQL. However I wonder if it would be possible to do that instead which might deduplicate some of the code?
The text was updated successfully, but these errors were encountered: