Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Created August 7, 2022 14:08
Show Gist options
  • Save khuyentran1401/c5fa3823c04be3560bb132cda5c8e40b to your computer and use it in GitHub Desktop.
Save khuyentran1401/c5fa3823c04be3560bb132cda5c8e40b to your computer and use it in GitHub Desktop.
from sqlalchemy import create_engine
engine = create_engine(
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}",
)
query = f'SELECT * FROM "{name}"'
df = pd.read_sql(query, con=engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment