Exemplo n.º 1
0
 def find_by_id(id: int) -> StepDto:
     try:
         with sql_fetch(StepDao._FIND_BY_ID, [id],
                        row_mapper=StepDao._map_full_row,
                        size=1) as step_dto:
             return step_dto
     except FetchOneException:
         raise NoResultException(f"No Step Found with id: {id}") from None
Exemplo n.º 2
0
 def find_by_id(id: int) -> RunDto:
     try:
         with sql_fetch(RunDao._FIND_BY_ID, [id],
                        row_mapper=RunDao._map_full_row,
                        size=1) as run_dto:
             return run_dto
     except FetchOneException:
         raise NoResultException(f"No Run Found with id: {id}") from None
Exemplo n.º 3
0
 def find_by_id(id: int) -> CommandDto:
     try:
         with sql_fetch(CommandDao._FIND_BY_ID, [id],
                        row_mapper=CommandDao._map_full_row,
                        size=1) as command_dto:
             return command_dto
     except FetchOneException:
         raise NoResultException(
             f"No Command Found with id: {id}") from None
Exemplo n.º 4
0
 def find_by_run_id_and_number(run_id: int, number: int):
     try:
         with sql_fetch(StepDao._FIND_BY_RUN_ID_AND_NUMBER,
                        [run_id, number],
                        row_mapper=StepDao._map_full_row,
                        size=1) as step_dto:
             return step_dto
     except FetchOneException:
         raise NoResultException(
             f"No Step Found with run_id: {run_id} and number: {number}")
Exemplo n.º 5
0
 def find_by_step_id_and_number(step_id: int, number: int) -> CommandDto:
     try:
         with sql_fetch(CommandDao._FIND_BY_STEP_ID_AND_NUMBER,
                        [step_id, number],
                        row_mapper=CommandDao._map_full_row,
                        size=1) as command_dto:
             return command_dto
     except FetchOneException:
         raise NoResultException(
             f"No Command Found with step_id: {step_id} and number: {number}"
         ) from None
Exemplo n.º 6
0
 def find_all_by_step_id(step_id: int) -> List[CommandDto]:
     with sql_fetch(CommandDao._FIND_BY_STEP_ID, [step_id],
                    row_mapper=CommandDao._map_full_row,
                    size=0) as step_dtos:
         return step_dtos
Exemplo n.º 7
0
 def find_all_by_run_id(run_id: int) -> List[StepDto]:
     with sql_fetch(StepDao._FIND_BY_RUN_ID, [run_id],
                    row_mapper=StepDao._map_full_row,
                    size=0) as step_dtos:
         return step_dtos
Exemplo n.º 8
0
 def find_jobs() -> List[JobDto]:
     with sql_fetch(JobDao._FIND_ALL_JOBS, [], row_mapper=JobDao._map_full_row, size=0) as jobs:
         return jobs
Exemplo n.º 9
0
 def find_job_by_uuid(uuid: str) -> JobDto:
     try:
         with sql_fetch(JobDao._FIND_JOB_BY_UUID, [uuid], row_mapper=JobDao._map_full_row, size=1) as job_dto:
             return job_dto
     except FetchOneException:
         raise NoResultException(f"No Job Found with uuid: {uuid}") from None
Exemplo n.º 10
0
 def find_all_by_job_id(id: int) -> List[RunDto]:
     with sql_fetch(RunDao._FIND_ALL_BY_JOB_ID, [id],
                    row_mapper=RunDao._map_full_row,
                    size=0) as run_dtos:
         return run_dtos