Skip to main content

Create Views and Materialized Views with SqlAlchemy

Project description

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)


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',
              Column('key', Integer),
              Column('value', String))

select_table =
view = View(

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(

# Execute 'CREATE VIEW myview AS (...)'

# Execute 'DROP VIEW myview'

Project details

Download files

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

Files for sqlalchemy-plus, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size sqlalchemy_plus-0.2.0-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sqlalchemy-plus-0.2.0.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page