Team Ai
Apppublic

Anuj-Panthri/mlops_postgres

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
test_pg.py25 linesDownload Raw Back to root
1import os2import dotenv3import psycopg24 5dotenv.load_dotenv()6 7conn = psycopg2.connect(8    # host="anuj-panthri-mlops-postgres.hf.space",9    # port=443,10    host="localhost",11    port=5432,12    user=os.environ["POSTGRES_USER"],13    password=os.environ["POSTGRES_PASSWORD"],14    database=os.environ["POSTGRES_DB"],15    connect_timeout=5,16)17conn.autocommit = True18 19curr = conn.cursor()20 21curr.execute("""22CREATE TABLE friend(23    name char24);25""")