词条 | SQLAlchemy |
释义 |
| name = SQLAlchemy | title = | logo = | screenshot = | caption = | collapsible = | author = Michael Bayer[1][2] | developer = | released = {{Start date and age|2006|02|14}}[3] | discontinued = | latest release version = 1.2.14 | latest release date = {{Start date and age|2018|11|10}}[4] | latest preview version = 1.3.0-b1 | latest preview date = {{Start date and age|2018|11|17}}[4] | programming language = Python | operating system = Cross-platform | platform = | size = | language = | genre = Object-relational mapping | license = MIT License[5] }}SQLAlchemy is an open-source SQL toolkit and object-relational mapper (ORM) for the Python programming language released under the MIT License.[5] DescriptionSQLAlchemy provides "a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language". SQLAlchemy's philosophy is that relational databases behave less like object collections as the scale gets larger and performance starts being a concern, while object collections behave less like tables and rows as more abstraction is designed into them. For this reason it has adopted the data mapper pattern (similar to Hibernate for Java) rather than the active record pattern used by a number of other object-relational mappers.[6] However, optional plugins allow users to develop using declarative syntax.[7] HistorySQLAlchemy was first released in February 2006[8][3] and has quickly become one of the most widely used object-relational mapping tools in the Python community, alongside Django's ORM. ExampleThe following example represents an n-to-1 relationship between movies and their directors. It is shown how user-defined Python classes create corresponding database tables, how instances with relationships are created from either side of the relationship, and finally how the data can be queried—illustrating automatically-generated SQL queries for both lazy and eager loading. Schema definitionCreating two Python classes and according database tables in the DBMS: Data insertionOne can insert a director-movie relationship via either entity: QueryingSQLAlchemy issues the following query to the DBMS (omitting aliases): The output: Setting See also{{Portal|Free and open-source software}}
References1. ^Mike Bayer is the creator of SQLAlchemy and Mako Templates for Python. 2. ^[https://decisionstats.com/2015/12/29/interview-mike-bayer-sqlalchemy-pydata-python/ Interview Mike Bayer SQLAlchemy #pydata #python] 3. ^1 {{Cite web|url=http://www.sqlalchemy.org/download.html|accessdate=21 February 2015|title=Download - SQLAlchemy|publisher=SQLAlchemy}} 4. ^1 {{cite web|url=https://github.com/sqlalchemy/sqlalchemy/releases|via=GitHub|title=Releases - sqlalchemy/sqlalchemy|accessdate=30 November 2018}} 5. ^1 {{Cite web|url=https://bitbucket.org/zzzeek/sqlalchemy/src/775ff3419fa03ddbb1b4b6d7350344b69df461ef/LICENSE|title=zzzeek / sqlalchemy / source / LICENSE|accessdate=21 February 2015|publisher=BitBucket}} 6. ^in The architecture of open source applications 7. ^declarative 8. ^http://decisionstats.com/2015/12/29/interview-mike-bayer-sqlalchemy-pydata-python/
External links
4 : 2006 software|Object-relational mapping|Python libraries|Software using the MIT license |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。