GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.sqlalchemy.org — SQLAlchemy Unified Tutorial — SQLAlchemy 2.1 Documentation
Release: 2.1.8
current release
| Release Date: November 3, 2026
SQLAlchemy 2.1 DocumentationSQLAlchemy 2.1 Documentation
Project Versions
SQLAlchemy Unified Tutorial¶About this document The SQLAlchemy Unified Tutorial is integrated between the Core and ORM
components of SQLAlchemy and serves as a unified introduction to SQLAlchemy
as a whole. For users of SQLAlchemy within the 1.x series, in the
2.0 style of working, the ORM uses Core-style querying with the
Users who are already familiar with SQLAlchemy, and especially those looking to migrate existing applications to work under the SQLAlchemy 2.0 series within the 1.4 transitional phase should check out the SQLAlchemy 2.0 - Major Migration Guide document as well. For the newcomer, this document has a lot of detail, however by the end they will be considered an Alchemist. SQLAlchemy is presented as two distinct APIs, one building on top of the other. These APIs are known as Core and ORM. SQLAlchemy Core is the foundational architecture for SQLAlchemy as a “database toolkit”. The library provides tools for managing connectivity to a database, interacting with database queries and results, and programmatic construction of SQL statements. Sections that are primarily Core-only will not refer to the ORM.
SQLAlchemy constructs used in these sections will be imported from the
SQLAlchemy ORM builds upon the Core to provide optional object relational mapping capabilities. The ORM provides an additional configuration layer allowing user-defined Python classes to be mapped to database tables and other constructs, as well as an object persistence mechanism known as the Session. It then extends the Core-level SQL Expression Language to allow SQL queries to be composed and invoked in terms of user-defined objects. Sections that are primarily ORM-only should be titled to
include the phrase “ORM”, so that it’s clear this is an ORM related topic.
SQLAlchemy constructs used in these sections will be imported from the
Most sections in this tutorial discuss Core concepts that are also used explicitly with the ORM. SQLAlchemy 2.0 in particular features a much greater level of integration of Core API use within the ORM. For each of these sections, there will be introductory text discussing the
degree to which ORM users should expect to be using these programming
patterns. SQLAlchemy constructs in these sections will be imported from the
Tutorial Overview¶The tutorial will present both concepts in the natural order that they should be learned, first with a mostly-Core-centric approach and then spanning out into more ORM-centric concepts. The major sections of this tutorial are as follows:
Version Check¶This tutorial is written using a system called doctest. All of the code excerpts
written with a If running the examples, it is advised that the reader performs a quick check to verify that we are on version 2.1 of SQLAlchemy: >>> import sqlalchemy >>> sqlalchemy.__version__ 2.1.0
Previous:
Overview
Next:
Establishing Connectivity - the Engine
© Copyright 2007-2026, the SQLAlchemy authors and contributors.
flambé! the dragon and The Alchemist image designs created and generously donated by Rotem Yaari. Created using Sphinx 9.1.0. Documentation last generated: Wed 11 Nov 2026 04:01:21 PM EST |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |