covot/database/__init__.py

10 lines
344 B
Python
Raw Permalink Normal View History

2020-12-28 18:44:59 +01:00
from sqlalchemy import create_engine
2020-11-17 14:16:44 +01:00
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from constants import DATABASE
engine = create_engine(DATABASE, connect_args={"check_same_thread": False})
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()