SQLAlchemy 2.0.0 is the first production-ready version of the SQLAlchemy 2.0 series and is now officially GA.
SQLAlchemy is a Python SQL toolkit and database object mapping (ORM) framework. It contains a complete set of enterprise-level persistence patterns designed for efficient and high-performance database access.
2.0 aims toAdapted to practical use in modern Python, the development team spent more than three years upgrading the SQLAlchemy use-case model and architecture. They say that since the first release of SQLAlchemy in 2006, three major Python paradigms have emerged: Python 3, pep-484 type support, and asyncio. The 2.0 update of SQLAlchemy is precisely to adapt to the constant changes in the Python community. And the Python community is larger than it was 16 years ago, with more new developers who have higher standards for rigor, ease of use, and documentation.
According to reports, the history of the SQLAlchemy 2.0 series began four years ago on August 8, 2018, with some short thoughts on how to unify the core concepts of SQLAlchemy and ORM queries.The first plan for the real “SQLAlchemy 2.0” concept was formed in November of that year, focusing onDramatically simplified Core execution and transaction APIsand seek to unify the two domains of querying across Core and ORM.
The changes to the underlying concepts are so pronounced that SQLAlchemy 2.0 is broken into two major phases.The first stage is SQLAlchemy 1.4 series, it provides a new unified Core/ORM SQL query system, and is built on a new general statement cache architecture. This phase provides a complete implementation of SQLAlchemy 2.0’s SQL build methods (minimum pep-484 type support), while fully maintaining the legacy query API. Along with this release, a comprehensive migration path inspired by lessons learned during the Python 2->3 migration process describes how to port applications so that they can continue to run in SQLAlchemy 1.4 while being fully forward compatible with SQLAlchemy 2.0.
The second stage is SQLAlchemy 2.0 series, which removed most of the deprecated elements, relegated the remaining elements (mainly Query) to long-term “legacy” status, and only fully migrated to Python 3, while adding many new features built on top of the new architecture , taking full advantage of Python 3 features (including data classes, enums, inline comments) and the new unified query architecture.
A key advantage of this approach is that the most significant and by far riskiest architectural change, the one that rewrites Core/ORM queries on top of the new caching layer, has been in production with SQLAlchemy 1.4 for almost two years. So while SQLAlchemy 2.0 will certainly have many new problems once it is used by all developers, they should not be “new cracks in the foundational approach”, since the architectural foundation is already widely used.
Officials expect the vast majority of issues to be related to the new type system, and problems adjusting existing applications to use the new API.
SQLAlchemy 2.0 is a very large version update, it hastwoMigration guide:
- Major Migration Guide – Describes how to make your application API Compatible so that it runs equally in SQLAlchemy 1.4 or 2.0
- What’s New in SQLAlchemy 2.0 – Provides all new features and APIs available to applications running on SQLAlchemy 2.0.
For detailed update instructions, see the release announcement.
#SQLAlchemy #officially #released #Python #ORM #framework #News Fast Delivery