Skip to main content

Amazon Redshift Dialect for sqlalchemy

Project description

Amazon Redshift dialect for SQLAlchemy.

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.

Running Tests

Tests are ran via tox and can be run with the following command:

$ tox

However, this will not run integration tests unless the following environment variables are set:

  • REDSHIFT_HOST

  • REDSHIFT_PORT

  • REDSHIFT_USERNAME

  • PGPASSWORD (this is the redshift instance password)

  • REDSHIFT_DATABASE

  • REDSHIFT_IAM_ROLE_ARN

Note that the IAM role specified will need to be associated with redshift cluster and have the correct permissions to create databases and tables as well drop them. Exporting these environment variables in your shell and running tox will run the integration tests against a real redshift instance. Practice caution when running these tests against a production instance.

Continuous Integration (CI)

Project CI is built using AWS CodePipeline and CloudFormation. Please see the ci/ folder and included README.txt for details on how to spin up the project’s CI.

Releasing

To perform a release, you will need to be an admin for the project on GitHub and on PyPI. Contact the maintainers if you need that access.

You will need to have a ~/.pypirc with your PyPI credentials and also the following settings:

[zest.releaser]
create-wheels = yes

To perform a release, run the following:

python -m venv ~/.virtualenvs/dist
workon dist
pip install -U pip setuptools wheel
pip install -U tox zest.releaser
fullrelease  # follow prompts, use semver ish with versions.

The releaser will handle updating version data on the package and in CHANGES.rst along with tagging the repo and uploading to 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

deepnote_sqlalchemy_redshift-0.8.17.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

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

deepnote_sqlalchemy_redshift-0.8.17-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file deepnote_sqlalchemy_redshift-0.8.17.tar.gz.

File metadata

File hashes

Hashes for deepnote_sqlalchemy_redshift-0.8.17.tar.gz
Algorithm Hash digest
SHA256 8f20417763b569cc799ccfc4980aef08765d351e32ca0ac471fc5b325cb160f3
MD5 712b2a2302668292bcb318706a966e3d
BLAKE2b-256 730fcf1705a36552727d18eb25258cccd377e8b03e1f22b3a748c2e44115f303

See more details on using hashes here.

File details

Details for the file deepnote_sqlalchemy_redshift-0.8.17-py3-none-any.whl.

File metadata

File hashes

Hashes for deepnote_sqlalchemy_redshift-0.8.17-py3-none-any.whl
Algorithm Hash digest
SHA256 96c6bb4760d6298a783728d73ef425cee7d5eaf2039850f49916ff4af473cd1f
MD5 a6b0c290a0026040539a6f9888d24082
BLAKE2b-256 40fb5eef5b91a182a19bf825f964135893277eab89a023d151b7e81d24c1bcda

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