Skip to main content

Amazon Redshift Dialect for sqlalchemy

Project description

Amazon Redshift dialect for SQLAlchemy.

Travis CI build status

Installation

The package is available on PyPI:

pip install sqlalchemy-redshift

Usage

The DSN format is similar to that of regular Postgres:

>>> import sqlalchemy as sa
>>> sa.create_engine('redshift+psycopg2://username@host.amazonaws.com:5439/database')
Engine(redshift+psycopg2://username@host.amazonaws.com:5439/database)

See the RedshiftDDLCompiler documentation for details on Redshift-specific features the dialect supports.

0.5.1 (unreleased)

  • Support role-based access control in COPY and UNLOAD commands (Issue #88)

  • Increase max_identifier_length to 127 characters (Issue #96)

  • Fix a bug where table names containing a period caused an error on reflection (Issue #97)

  • Performance improvement for reflection by caching table constraint info (Issue #101)

0.5.0 (2016-04-21)

  • Support reflecting tables with foriegn keys to tables in non-public schemas (Issue #70)

  • Fix a bug where DISTKEY and SORTKEY could not be used on column names containing spaces or commas. This is a breaking behavioral change for a command like __table_args__ = {‘redshift_sortkey’: (‘foo, bar’)}. Previously, this would sort on the columns named foo and bar. Now, it sorts on the column named foo, bar. (Issue #74)

0.4.0 (2015-11-17)

  • Change the name of the package to sqlalchemy_redshift to match the naming convention for other dialects; the redshift_sqlalchemy package now emits a DeprecationWarning and references sqlalchemy_redshift. The redshift_sqlalchemy compatibility package will be removed in a future release. (Issue #58)

  • Fix a bug where reflected tables could have incorrect column order for some CREATE TABLE statements, particularly for columns with an IDENTITY constraint. (Issue #60)

  • Fix a bug where reflecting a table could raise a NoSuchTableError in cases where its schema is not on the current search_path (Issue #64)

  • Add python 3.5 to the list of versions for integration tests. (Issue #61)

0.3.1 (2015-10-08)

  • Fix breakages to CopyCommand introduced in 0.3.0: Thanks solackerman. (Issue #53)

    • When format is omitted, no FORMAT AS … is appended to the query. This makes the default the same as a normal redshift query.

    • fix STATUPDATE as a COPY parameter

0.3.0 (2015-09-29)

  • Fix view support to be more in line with SQLAlchemy standards. get_view_definition output no longer includes a trailing semicolon and views no longer raise an exception when reflected as Table objects. (Issue #46)

  • Rename RedShiftDDLCompiler to RedshiftDDLCompiler. (Issue #43)

  • Update commands (Issue #52)

    • Expose optional TRUNCATECOLUMNS in CopyCommand.

    • Add all other COPY parameters to CopyCommand.

    • Move commands to their own module.

    • Support inserts into ordered columns in CopyCommand.

0.2.0 (2015-09-04)

  • Use SYSDATE instead of NOW(). Thanks bouk. (Issue #15)

  • Default to SSL with hardcoded AWS Redshift CA. (Issue #20)

  • Refactor of CopyCommand including support for specifying format and compression type. (Issue #21)

  • Explicitly require SQLAlchemy >= 0.9.2 for ‘dialect_options’. (Issue #13)

  • Refactor of UnloadFromSelect including support for specifying all documented redshift options. (Issue #27)

  • Fix unicode issue with SORTKEY on python 2. (Issue #34)

  • Add support for Redshift DELETE statements that refer other tables in the WHERE clause. Thanks haleemur. (Issue #35)

  • Raise NoSuchTableError when trying to reflect a table that doesn’t exist. (Issue #38)

0.1.2 (2015-08-11)

  • Register postgresql.visit_rename_table for redshift’s alembic RenameTable. Thanks bouk. (Issue #7)

0.1.1 (2015-05-20)

  • Register RedshiftImpl as an alembic 3rd party dialect.

0.1.0 (2015-05-11)

  • First version of sqlalchemy-redshift that can be installed from PyPI

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

File details

Details for the file sqlalchemy-redshift-psycopg2cffi-0.5.1.dev1.tar.gz.

File metadata

File hashes

Hashes for sqlalchemy-redshift-psycopg2cffi-0.5.1.dev1.tar.gz
Algorithm Hash digest
SHA256 dcb9ebef140aa99d61fbb548cb38f8764baf49606e271e9e1c111ca06d56f479
MD5 aae6f2287a027f921be77723b14aa917
BLAKE2b-256 ad5536de13a6545296f5881b16b96b0e7470f5733ea1de7b9a3bd0620f4b1152

See more details on using hashes here.

Supported by

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