Example #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
Example #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
Example #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
Example #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}")
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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