|
1 | 1 | Frequently Asked Questions
|
2 | 2 | ==========================
|
3 | 3 |
|
| 4 | +SQLAlchemy 1.4 supports asyncio, what will GINO be? |
| 5 | +--------------------------------------------------- |
| 6 | + |
| 7 | +Starting from 1.4, SQLAlchemy will `support asyncio |
| 8 | +<https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#asynchronous-io-support-for-core-and-orm>`__. |
| 9 | +This is a great news to the SQLAlchemy-based ORMs including GINO, because the users will |
| 10 | +have one more option, and many GINO hacks can be eventually cleaned up. SQLAlchemy |
| 11 | +achieved both sync and async API with the same code base by encapsulating the use of |
| 12 | +`greenlet <https://greenlet.readthedocs.io/en/latest/>`__. As an "async" user, you don't |
| 13 | +need to worry about its internals in most cases, it's fine to just use its async APIs. |
| 14 | +Both SQLAlchemy Core and ORM will be async-compatible, but some ORM features that |
| 15 | +involve implicit database accesses are disallowed. |
| 16 | + |
| 17 | +Given such news, GINO no longer has to maintain its own asyncpg dialect for SQLAlchemy |
| 18 | +in future versions (yay!). Still, GINO will focus on the differences and keep a |
| 19 | +compatible API. To list some of the different/future features: |
| 20 | + |
| 21 | +* Contextual Connections (see :doc:`../explanation/engine`) |
| 22 | +* SQLAlchemy Core-based CRUD models |
| 23 | +* The GINO Loader system |
| 24 | +* Async MySQL support |
| 25 | +* Typing support :sup:`NEW` |
| 26 | +* `Trio <https://trio.readthedocs.io/en/stable/>`__ support :sup:`NEW` |
| 27 | +* Execution performance :sup:`NEW` |
| 28 | + |
| 29 | +As SQLAlchemy async support is considered in Alpha level, GINO will include SQLAlchemy |
| 30 | +1.4 support in GINO 2.0.0-alpha.x releases, while the current GINO 1.0.x and 1.1.x will |
| 31 | +remain on SQLAlchemy 1.3. GINO 1.x will receive bug fixes and security updates until |
| 32 | +both SQLAlchemy async support and GINO 2.x are stabilized. |
| 33 | + |
| 34 | + |
4 | 35 | ORM or not ORM?
|
5 | 36 | ---------------
|
6 | 37 |
|
|
0 commit comments