サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ノーベル賞
docs.sqlalchemy.org
Note for Readers SQLAlchemy 2.0’s transition documents are separated into two documents - one which details major API shifts from the 1.x to 2.x series, and the other which details new features and behaviors relative to SQLAlchemy 1.4: SQLAlchemy 2.0 - Major Migration Guide - this document, 1.x to 2.x API shifts What’s New in SQLAlchemy 2.0? - new features and behaviors for SQLAlchemy 2.0 Readers
Contextual/Thread-local Sessions¶ Recall from the section When do I construct a Session, when do I commit it, and when do I close it?, the concept of “session scopes” was introduced, with an emphasis on web applications and the practice of linking the scope of a Session with that of a web request. Most modern web frameworks include integration tools so that the scope of the Session can be managed
function sqlalchemy.orm.relationship(argument: _RelationshipArgumentType[Any] | None = None, secondary: _RelationshipSecondaryArgument | None = None, *, uselist: bool | None = None, collection_class: Type[Collection[Any]] | Callable[[], Collection[Any]] | None = None, primaryjoin: _RelationshipJoinConditionArgument | None = None, secondaryjoin: _RelationshipJoinConditionArgument | None = None, bac
Performance¶ Why is my application slow after upgrading to 1.4 and/or 2.x?¶ SQLAlchemy as of version 1.4 includes a SQL compilation caching facility which will allow Core and ORM SQL constructs to cache their stringified form, along with other structural information used to fetch results from the statement, allowing the relatively expensive string compilation process to be skipped when another str
Basic Relationship Patterns¶ A quick walkthrough of the basic relational patterns, which in this section are illustrated using Declarative style mappings based on the use of the Mapped annotation type. The setup for each of the following sections is as follows: from __future__ import annotations from typing import List from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchem
We’ve Moved! This page is the previous home of the SQLAlchemy 1.x Tutorial. As of 2.0, SQLAlchemy presents a revised way of working and an all new tutorial that presents Core and ORM in an integrated fashion using all the latest usage patterns. See SQLAlchemy Unified Tutorial. © Copyright 2007-2024, the SQLAlchemy authors and contributors. flambé! the dragon and The Alchemist image designs created
We’ve Moved! This page is the previous home of the SQLAlchemy 1.x Tutorial. As of 2.0, SQLAlchemy presents a revised way of working and an all new tutorial that presents Core and ORM in an integrated fashion using all the latest usage patterns. See SQLAlchemy Unified Tutorial.
© Copyright 2007-2024, the SQLAlchemy authors and contributors. flambé! the dragon and The Alchemist image designs created and generously donated by Rotem Yaari. Created using Sphinx 7.2.6. Documentation last generated: Thu 05 Sep 2024 12:09:25 PM EDT Website content copyright © by SQLAlchemy authors and contributors. SQLAlchemy and its documentation are licensed under the MIT license. SQLAlchemy
Engine Configuration¶ The Engine is the starting point for any SQLAlchemy application. It’s “home base” for the actual database and its DBAPI, delivered to the SQLAlchemy application through a connection pool and a Dialect, which describes how to talk to a specific kind of database/DBAPI combination. The general structure can be illustrated as follows: Where above, an Engine references both a Dial
The Type Hierarchy¶ SQLAlchemy provides abstractions for most common database data types, as well as several techniques for customization of datatypes. Database types are represented using Python classes, all of which ultimately extend from the base type class known as TypeEngine. There are two general categories of datatypes, each of which express themselves within the typing hierarchy in differe
ORM Examples¶ The SQLAlchemy distribution includes a variety of code examples illustrating a select set of patterns, some typical and some not so typical. All are runnable and can be found in the /examples directory of the distribution. Descriptions and source code for all can be found here. Additional SQLAlchemy examples, some user contributed, are available on the wiki at https://www.sqlalchemy.
Connection Pooling¶ A connection pool is a standard technique used to maintain long running connections in memory for efficient re-use, as well as to provide management for the total number of connections an application might use simultaneously. Particularly for server-side web applications, a connection pool is the standard way to maintain a “pool” of active database connections in memory which a
Working with Engines and Connections¶ This section details direct usage of the Engine, Connection, and related objects. Its important to note that when using the SQLAlchemy ORM, these objects are not generally accessed; instead, the Session object is used as the interface to the database. However, for applications that are built around direct usage of textual SQL statements and/or SQL expression c
© Copyright 2007-2024, the SQLAlchemy authors and contributors. flambé! the dragon and The Alchemist image designs created and generously donated by Rotem Yaari. Created using Sphinx 7.2.6. Documentation last generated: Thu 19 Sep 2024 06:02:02 PM EDT Website content copyright © by SQLAlchemy authors and contributors. SQLAlchemy and its documentation are licensed under the MIT license. SQLAlchemy
DBAPI Support¶ The following dialect/DBAPI options are available. Please refer to individual DBAPI sections for connect information. psycopg2 psycopg (a.k.a. psycopg 3) pg8000 asyncpg psycopg2cffi Sequences/SERIAL/IDENTITY¶ PostgreSQL supports sequences, and SQLAlchemy uses these as the default means of creating new primary key values for integer-based primary key columns. When creating tables, SQ
DBAPI Support¶ The following dialect/DBAPI options are available. Please refer to individual DBAPI sections for connect information. mysqlclient (maintained fork of MySQL-Python) PyMySQL MariaDB Connector/Python MySQL Connector/Python asyncmy aiomysql CyMySQL PyODBC Supported Versions and Features¶ SQLAlchemy supports MySQL starting with version 5.0.2 through modern releases, as well as all modern
New to SQLAlchemy? Start here: For Python Beginners: Installation Guide - basic guidance on installing with pip and similar For Python Veterans: SQLAlchemy Overview - brief architectural overview New users of SQLAlchemy, as well as veterans of older SQLAlchemy release series, should start with the SQLAlchemy Unified Tutorial, which covers everything an Alchemist needs to know when using the ORM or
このページを最初にブックマークしてみませんか?
『docs.sqlalchemy.org』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く