Last active
May 8, 2024 16:00
-
-
Save Muazzeem/d9803cc72f12205b5ed504e9ddb98ee9 to your computer and use it in GitHub Desktop.
Connect database
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
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