Last active
July 18, 2018 21:39
-
-
Save ammarmallik/01c26655330ae13c001daee06ed8b299 to your computer and use it in GitHub Desktop.
For Redshift connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine, text | |
connection_string = "postgresql+psycopg2://%s:%s@%s:%s/%s" % ('admin','qh75dPL9GTCJ5ToEh79G','lifeprintstage.cbld5jqqok7d.us-east-1.redshift.amazonaws.com',str(5439),'lifeprintstage') | |
engine = create_engine(connection_string) | |
conn = engine.connect() | |
query = "SELECT * FROM `table`" | |
result = conn.execute(text(query)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment