Skip to content

Instantly share code, notes, and snippets.

@anbento0490
Created March 5, 2021 08:11
Show Gist options
  • Save anbento0490/e6b885f6fd7202c40d0fdc765bacf9a9 to your computer and use it in GitHub Desktop.
Save anbento0490/e6b885f6fd7202c40d0fdc765bacf9a9 to your computer and use it in GitHub Desktop.
#### INPUT YOUR CREDENTIALS ###
DATABASE = "database_name"
USER = "your_user_name"
PASSWORD = "your_pw"
HOST = "company_name.eu-west-1.redshift.amazonaws.com"
PORT = "5439"
### CREATE A CONNECTION TO REDSHIFT DB
connection_string = "postgresql+psycopg2://%s:%s@%s:%s/%s" % (USER,PASSWORD,HOST,str(PORT),DATABASE)
engine = sa.create_engine(connection_string)
connection = engine.connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment