17 lines
454 B
Python
17 lines
454 B
Python
|
from sqlalchemy import create_engine
|
||
|
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
|
||
|
from sqlalchemy.orm import sessionmaker
|
||
|
|
||
|
from configs import SQLALCHEMY_DATABASE_URI
|
||
|
import json
|
||
|
|
||
|
|
||
|
engine = create_engine(
|
||
|
SQLALCHEMY_DATABASE_URI,
|
||
|
json_serializer=lambda obj: json.dumps(obj, ensure_ascii=False),
|
||
|
)
|
||
|
|
||
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||
|
|
||
|
Base: DeclarativeMeta = declarative_base()
|