Skip to main content

Executes SQL commands from STDIN in a single transaction

Project description

This tool accepts either a Redshift username and password OR an AWS Access Key ID and Secret Key.

If you use the IAM Access/Secret method, the user that you are referencing MUST have the correct policy to get temporary credentials from the database. For example:

{
  "Version": "2012-10-17",
  "Statement": {
    "Effect": "Allow",
    "Action": "redshift:GetClusterCredentials",
    "Resource": [
      "arn:aws:redshift:us-west-2:123456789012:dbuser:examplecluster/temp_creds_user",
      "arn:aws:redshift:us-west-2:123456789012:dbname:examplecluster/dev_database"
    ]
  }
}

Usage

python -m redshiftsql host dbname user file --password password --port port

OR

python -m redshiftsql host dbname user file --aws-access-key-id aws-access-key-id --aws-secret-key aws-secret-key --cluster-name cluster-name --port port

Arguments

  • host The Redshift endpoint, minus the port

  • dbname The Redshift database to connect to

  • user The Redshift user

  • password The Redshift password. Ignored if aws-access-key-id is present

  • port The port on the host. Defaults to 5439

  • file The file to read the SQL commands from

  • aws-access-key-id The AWS Access Key ID for the IAM user to obtain temporary credentials

  • aws-secret-key The AWS Secret Key for the IAM user to obtain temporary credentials

  • cluster-name The Redshift cluster name to obtain temporary credentials from

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

redshiftsql-0.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

redshiftsql-0.0.4-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file redshiftsql-0.0.4.tar.gz.

File metadata

  • Download URL: redshiftsql-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redshiftsql-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4c7fb863541df478da57835d1142100bdff1f2e7175ed2beb0ee411ddf6db40e
MD5 615fab93d25d129f75c40da48eb63240
BLAKE2b-256 cfc5fc5aa7cb6a436e2e40faf7fc03fb5bbca999fbf00316f54dbdb72052c07b

See more details on using hashes here.

File details

Details for the file redshiftsql-0.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for redshiftsql-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b1d2bbaed87089e1276ac0c19248a39d3849253ef8fb7c511a05d69e256f53fe
MD5 cb9ab8a388187ae404413475e9bd4e80
BLAKE2b-256 1fe0ef4e5a2c8bf2e36ba64af59937bd8077a8604940dc9e16e7de9cbc1c82e5

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