]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support for Create Table As
authorGreg Jarzab <greg.jarzab@gmail.com>
Tue, 23 Sep 2025 13:08:46 +0000 (09:08 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 25 Oct 2025 18:24:46 +0000 (14:24 -0400)
commit7f5e9e733c7b77e55af8836d1ff182c861ab5d16
treef8a12ad134d9a8d48cb7687dc9f293ed55a76956
parent33f93745bc9adcdc521bda22939d1edc5ae53110
Support for Create Table As

Added support for the SQL ``CREATE TABLE ... AS SELECT`` construct via the
new :class:`_sql.CreateTableAs` DDL construct and the
:meth:`_sql.SelectBase.into` method. The new construct allows creating a
table directly from the results of a SELECT statement, with support for
options such as ``TEMPORARY`` and ``IF NOT EXISTS`` where supported by the
target database.  Pull request courtesy Greg Jarzab.

Fixes: #4950
Closes: #12860
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12860
Pull-request-sha: 7de8a109b892fd91222ce2f59c388ca275021ddb

Change-Id: Id9c8e4a3c520ffc61de1e48e331b6220e3d52fc9
18 files changed:
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/4950.rst [new file with mode: 0644]
doc/build/core/ddl.rst
doc/build/tutorial/data_select.rst
lib/sqlalchemy/__init__.py
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/__init__.py
lib/sqlalchemy/testing/suite/test_create_table_as.py [new file with mode: 0644]
lib/sqlalchemy/util/preloaded.py
pyproject.toml
test/requirements.py
test/sql/test_create_table_as.py [new file with mode: 0644]
test/typing/plain_files/sql/create_table_as.py [new file with mode: 0644]