Mysql related functionality finished

This commit is contained in:
marys
2025-09-26 10:47:57 +02:00
parent 795a494950
commit c850a07ff0
11 changed files with 184 additions and 5 deletions

22
utils/db/db_execution.py Normal file
View File

@@ -0,0 +1,22 @@
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from models.execution.model_execution import ExecutionModel
class ExecutionQueryAsync:
def __init__(self, db: AsyncSession):
self.db = db
async def get_execution(self):
result = await self.db.execute(select(ExecutionModel))
rows = result.scalars().all()
return rows
async def get_execution_by_id(self, id):
stmt = select(ExecutionModel).where(ExecutionModel.id == id)
result = await self.db.execute(stmt)
rows = result.scalars().all()
return rows