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
native asynchronous driver support #9
Comments
So the trick is figuring out how sqlalchemy itself uses the underlying connection. My inclination is that we'd have to replace more layers, and probably copy-paste-and-edit more code. I'm definitely in favor of this, but I think it's non-trivial. |
Would the dialect level be the right place? https://bitbucket.org/zzzeek/sqlalchemy/src/2b1c3d8821b3b375a6148d583f05bd65810e3faf/README.dialects.rst?at=master |
Maybe. It's all about the relationship between all the pieces, and being able to propogate deferreds correctly. |
+1 for a txpostgres based alchimia. |
I've looked into this a little bit more. Working backwards from the raw cursor level:
Note, this is only to execute a query via the Finally there would need to be some changes or subclassing done in txpostgres to give better access to the raw dbapi connection and cursor instances. This raises the question, is building this on txpostgres even the right approach? The core of txpostgres is quite small, perhaps it would be easier to create something inspired by it with an api friendlier to sqlalchemy. Anyway... monday morning musings :) |
On Sun, Aug 24, 2014 at 6:08 PM, David Novakovic notifications@github.com
"I disapprove of what you say, but I will defend to the death your right to |
👍 This would be really cool to have. |
Changing the name on this issue because although txpostgres may well satisfy the goal, so might https://magicstack.github.io/asyncpg/ or https://pypi.python.org/pypi/aiomysql/ or http://aiopg.readthedocs.io/en/stable/ - alchimia should probably be able to work with more than one of these (especially since many async-plus-sqlalchemy things are so database-specific right now) |
Also, I should note: now that the main entrypoint into the library is |
@aiopg does exactly that: https://aiopg.readthedocs.io/en/stable/sa.html |
it looks like the engine code is mostly copied, with |
I haven't used aiopg but FWIW asyncpg is great. |
@dpnova @graingert Anyone feel like wrapping one of these up into a PR? :) |
I'm starting this as a place to have the conversation about a txpostgres implementation of this. I'm willing to work on it as I'm starting a new project that would benefit from it.
Having checked the source so far, I think the majority of the work would be abstracting the deferToThread stuff into a less thread-y naming convention and then hooking up the txpostgres connection objects.
the txpostgres pool is pretty limited compared to the sqla ones, so there may be a little bit of integration worth doing there too.
Anyone have any other thoughts?
The text was updated successfully, but these errors were encountered: