feat: new file
This commit is contained in:
15
backend/app/db.py
Normal file
15
backend/app/db.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.engine import Engine
|
||||
|
||||
from .settings import settings
|
||||
|
||||
|
||||
def get_engine() -> Engine:
|
||||
return create_engine(
|
||||
settings.mysql_url,
|
||||
pool_pre_ping=True,
|
||||
pool_recycle=3600,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user