summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio/engine.py
Commit message (Collapse)AuthorAgeFilesLines
* Detect non compatible execution in async modeFederico Caselli2020-12-081-0/+3
| | | | | | | | | | The SQLAlchemy async mode now detects and raises an informative error when an non asyncio compatible :term:`DBAPI` is used. Using a standard ``DBAPI`` with async SQLAlchemy will cause it to block like any sync call, interrupting the executing asyncio loop. Change-Id: I9aed87dc1b0df53e8cb2109495237038aa2cb2d4
* generalize scoped_session proxying and apply to asyncio elementsMike Bayer2020-10-101-13/+140
| | | | | | | | | | | | | | | | | | | | Reworked the proxy creation used by scoped_session() to be based on fully copied code with augmented docstrings and moved it into langhelpers. asyncio session, engine, connection can now take advantage of it so that all non-async methods are availble. Overall implementation of most important accessors / methods on AsyncConnection, etc. , including awaitable versions of invalidate, execution_options, etc. In order to support an event dispatcher on the async classes while still allowing them to hold __slots__, make some adjustments to the event system to allow that to be present, at least rudimentally. Fixes: #5628 Change-Id: I5eb6929fc1e4fdac99e4b767dcfd49672d56e2b2
* upgrade to black 20.8b1Mike Bayer2020-09-281-12/+12
| | | | | | | It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
* Fix a mis-reference in create_async_engine().Fantix King2020-08-311-1/+1
| | | | | | | | | | | | | | `AsyncMethodRequired` is actually from `sqlalchemy.ext.asyncio.exc`, so here it should be referenced as `async_exc.AsyncMethodRequired`, instead of `exc.AsyncMethodRequired`. Fixes: #5529 Closes: #5545 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5545 Pull-request-sha: d8f885c587dd058f909d4f3bdbec3d0fca176680 Change-Id: I6886558bfd33d3e9e283fbd60c0ec971a1f22c0c
* Implement rudimentary asyncio support w/ asyncpgMike Bayer2020-08-131-0/+461
Using the approach introduced at https://gist.github.com/zzzeek/6287e28054d3baddc07fa21a7227904e We can now create asyncio endpoints that are then handled in "implicit IO" form within the majority of the Core internals. Then coroutines are re-exposed at the point at which we call into asyncpg methods. Patch includes: * asyncpg dialect * asyncio package * engine, result, ORM session classes * new test fixtures, tests * some work with pep-484 and a short plugin for the pyannotate package, which seems to have so-so results Change-Id: Idbcc0eff72c4cad572914acdd6f40ddb1aef1a7d Fixes: #3414