16 lines
350 B
Python
16 lines
350 B
Python
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import DeclarativeBase
|
|
|
|
from ..config import DatabaseConfig
|
|
|
|
|
|
def get_engine(config: DatabaseConfig):
|
|
engine = create_engine(config.url,
|
|
pool_recycle=3600,
|
|
pool_pre_ping=True)
|
|
return engine
|
|
|
|
|
|
class Base (DeclarativeBase):
|
|
pass
|