|
from sqlalchemy import create_engine |
|
from sqlalchemy.ext.declarative import declarative_base |
|
from sqlalchemy.orm import sessionmaker |
|
|
|
|
|
import os |
|
|
|
|
|
from sqlalchemy import URL |
|
|
|
db_url = URL.create( |
|
"postgresql", |
|
username="avnadmin", |
|
password="AVNS_u12fHxoNLBbzD8TGpqN", |
|
host="pg-opengenai-opengenai.b.aivencloud.com", |
|
database="defaultdb", |
|
port=14535, |
|
) |
|
|
|
SQLALCHEMY_DATABASE_URL = db_url |
|
|
|
|
|
engine = create_engine( |
|
SQLALCHEMY_DATABASE_URL, pool_size=10 |
|
) |
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) |
|
|
|
Base = declarative_base() |
|
|