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.17rc2.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.

File details

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

File metadata

File hashes

Hashes for deepnote_sqlalchemy_redshift-0.8.17rc2.tar.gz
Algorithm Hash digest
SHA256 7a2e4a694b246ed7153faaf8b75486d0f0bb1320cf6f5e0c23412061b76b53bc
MD5 4fb29c5d878f2a28f939e0538a1c87e8
BLAKE2b-256 39aa826808f8bd350d807108b31eb80a8d7eea6d32d21d520c96132eb6a486d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for deepnote_sqlalchemy_redshift-0.8.17rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecbc4359dcc689cc776a4b22280c72de4b24c19699ac6d18c4cb7954d8edff6d
MD5 44247fa649a2ace2e450d4fdf4f0186f
BLAKE2b-256 c97ea266e456514d187ec6dfceee0aae3774f9efc37f69a109b89bb966f644a6

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