database.py 271 B

123456789
  1. from sqlalchemy import create_engine
  2. from sqlalchemy.orm import sessionmaker, declarative_base
  3. DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/testdb"
  4. engine = create_engine(DATABASE_URL)
  5. SessionLocal = sessionmaker(bind=engine)
  6. Base = declarative_base()