mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-01-18 07:17:00 +00:00
9 lines
311 B
Python
9 lines
311 B
Python
import os
|
|
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
db_dir = os.path.abspath(os.getcwd() + "/data/db.sqlite")
|
|
engine = create_engine("sqlite:///" + db_dir, connect_args={"check_same_thread": True})
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|