Untitled

Markdown Detected Guest 10 Views Size: 968 bytes Posted on: May 26, 26 @ 8:49 AM

from sqlalchemy import create_engine,URL from sqlalchemy.orm import sessionmaker from dotenv import load_dotenv import os

load_dotenv()

DB_HOST = os.getenv("DB_HOST") DB_PORT = int(os.getenv("DB_PORT")) DB_USERNAME = os.getenv("DB_USER") DB_PASSWORD = os.getenv("DB_PASSWORD") DB_DATABASE = os.getenv("DB_NAME")

print(DB_HOST) print(DB_PORT) print(DB_USERNAME) print(DB_PASSWORD) print(DB_DATABASE)

database_info = URL.create(

drivername = "mysql+pymysql",

host = DB_HOST,

port = DB_PORT,

username = "root",

password = "5A4aXu",

database = "cova_thw"

)

database_info = URL.create( drivername = "mysql+pymysql", host = DB_HOST, port = DB_PORT, username = DB_USERNAME, password = DB_PASSWORD, database = DB_DATABASE )

print(database_info)

engine = create_engine(database_info)

SessionLocal = sessionmaker(bind=engine,autocommit=False,autoflush=False)

Raw Paste

Comments 0
Login to post a comment.
  • No comments yet. Be the first.
Login to post a comment. Login or Register
We use cookies. To comply with GDPR in the EU and the UK we have to show you these.

We use cookies and similar technologies to keep this website functional (including spam protection via Google reCAPTCHA or Cloudflare Turnstile), and — with your consent — to measure usage and show ads. See Privacy.