SQL Alchemy Plus
This package provide additional package definition for SqlAlchemy that are specific for PostgreSQL and other database.
Here are the currently supported features (database supported):
- View (PostgreSQL)
- Materialized View (PostgreSQL)
Installation
Install SQL Alchemy Plus using pip
pip install sqlalchemyplus
Quick start
Define a View or a Materialized View programmatically
from sqlalchemy import Table, select, Column, MetaData, Integer, String
from sqlalchemyplus import View
metadata = MetaData()
table = Table('mytable',
metadata,
Column('key', Integer),
Column('value', String))
select_table = table.select()
view = View(
'myview',
metadata,
select_table
)
Create and drop a view
from sqlalchemy import create_engine
from sqlalchemyplus import CreateView, DropView
engine = create_engine("postgresql://example:example@localhost:5432/mydatabase")
view = View(
'myview',
metadata,
select_table
)
# Execute 'CREATE VIEW myview AS (...)'
engine.execute(CreateView(view))
# Execute 'DROP VIEW myview'
engine.execute(CreateView(view))
Metadata
Release files for sqlalchemy-plus 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sqlalchemy-plus-0.2.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sqlalchemy_plus-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.9 kB
Release files / sqlalchemy-plus-0.2.0.tar.gz
| Download URL | sqlalchemy-plus-0.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ddc0ebcc81bc6363fe402e7e4626ad0f112ad0cf46c520cbf9253bd1ca44d3b
|
|
BLAKE2b-256 checksum How to use checksums |
2f112d3b7c0b5f1ea40bca25e2c3f3eaa926fd2d3bf3ea8e5d576101fbc23d38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / sqlalchemy_plus-0.2.0-py3-none-any.whl
| Download URL | sqlalchemy_plus-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f8d876c766e728e01c500fd6f2161226aec9c8d88fa2ce422f2fff39d29cc25
|
|
BLAKE2b-256 checksum How to use checksums |
513ad96cfa08e2cb6640bd51a62d1d659967c735ee73b8e5aecb500d52cd0d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|