Does aiohttp have ORM?

给你一囗甜甜゛ 提交于 2019-12-10 03:01:04

问题


There is relatively new Python 3 aiohttp library that contains client/server. Does it contain ORM? If not - is it possible to use it with 3-rd party ORM? If not possible - for which purpose it could be used? I don't mean that app could not be written without ORM, but major waste of Python Frameworks support it and developers are used to such style of programming.


回答1:


Short answer -- aiohttp has no ORM yet.

You can use SQLAlchemy-like queries for aiopg driver, see example

The same is available for aiomysql.

The support is not full-fledged Object-Relational Mapping but only helpers for making SQL queries easier.




回答2:


Update in 2018: there is GINO now, built on top of SQLAlchemy core and asyncpg for asyncio.



来源:https://stackoverflow.com/questions/32572544/does-aiohttp-have-orm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!