16 lines
381 B
Python
16 lines
381 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=config.pool_recycle,
|
|
pool_pre_ping=config.pool_pre_ping)
|
|
return engine
|
|
|
|
|
|
class Base (DeclarativeBase):
|
|
pass
|