Skip to content

Instantly share code, notes, and snippets.

@Muazzeem
Last active May 8, 2024 16:00
Show Gist options
  • Save Muazzeem/d9803cc72f12205b5ed504e9ddb98ee9 to your computer and use it in GitHub Desktop.
Save Muazzeem/d9803cc72f12205b5ed504e9ddb98ee9 to your computer and use it in GitHub Desktop.
Connect database
db_url = URL.create(
"postgresql+psycopg2",
username="postgres",
password="",
host="",
database="postgres",
)
engine = create_engine(db_url, connect_args={'connect_timeout': 10})
metadata = MetaData()
metadata.reflect(engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment