Skip to main content

module provide *create table as* statement

Project description

"Create Table As" form for SQLAlchemy

Add create table as construct to SQLalchemy

Usage

Examples:

>>> from sqlalchemy import *
>>> from sqlalchemy_create_table_as import *
>>> str(
...     CreateTableAs(
...         table('new_table'), 
...         select(column('f1'), column('f2')).select_from(table('old_table'))
...         )
... )
'CREATE TABLE new_table AS SELECT f1, f2 \nFROM old_table'
 
>>> t = Table('old_table', MetaData(), Column('f1'), Column('f2'))

>>> str(CreateTableAs(table('new_table'), select(t)))
>>> 'CREATE TABLE new_table AS SELECT old_table.f1, old_table.f2 \nFROM old_table'

Installation

...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlalchemy_create_table_as-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlalchemy_create_table_as-0.2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy_create_table_as-0.2.0.tar.gz.

File metadata

  • Download URL: sqlalchemy_create_table_as-0.2.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1030-azure

File hashes

Hashes for sqlalchemy_create_table_as-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ac78b2c7eba86acb411dd8dbc90757b035dcff8deea0a2cc379d9247c7e9f279
MD5 8d194c84993c21b1265a099831eae5be
BLAKE2b-256 f3f2b28235f304f5f80c3323138f8d6b5cf929340a1f9346e4e6001c479e92be

See more details on using hashes here.

File details

Details for the file sqlalchemy_create_table_as-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_create_table_as-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64623c09fa88d382b8246ff2fd3165ba0f1fc143b6c899f7f45db757dc9cc18d
MD5 2725f4f32b27658882997c8def99a511
BLAKE2b-256 9646db0f55c02cc31e6d0d9b920bf1faf3e49a1bdc1011d4d7395f7c32bafc9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page