def find_one_by_code(code: str) -> Optional[ServiceType]: log.debug("Looking for service_type with code=%s", code) row = db.one("SELECT * FROM service_type WHERE code=%(code)s", code=code) return ServiceType.construct(**row._asdict()) if row else None
def find_one_by_code(code: str) -> Optional[IntDom]: log.debug("Looking for int_dom with code=%s", code) row = db.one("SELECT * FROM int_dom WHERE code=%(code)s", code=code) return IntDom.construct(**row._asdict()) if row else None
def find_one_by_id(id: int) -> Optional[Color]: log.debug("Looking for color with id=%s", id) row = db.one("SELECT * FROM color WHERE id=%(id)s", id=id) return Color.construct(**row._asdict()) if row else None
def find_one_by_id(id: int) -> Optional[FlightToFlightPlan]: log.debug("Looking for flight to flight plan with id=%s", id) row = db.one("SELECT * FROM flight_to_flight_plan WHERE id=%(id)s", id=id) return FlightToFlightPlan.construct(**row._asdict()) if row else None
def find_one_by_id(id: int) -> Optional[Airline]: log.debug("Looking for airline with id=%s", id) row = db.one("SELECT * FROM airline WHERE id=%(id)s", id=id) return Airline.construct(**row._asdict()) if row else None
def find_one_by_id(id: str) -> Optional[Flight]: log.debug("Looking for flight with id=%s", id) row = db.one("SELECT * FROM flight WHERE id='%(id)s'", id=id) return Flight.construct(**row._asdict()) if row else None
def find_one_by_code(code: str) -> Optional[ArrDep]: log.debug("Looking for arr_dep with code=%s", code) row = db.one("SELECT * FROM arr_dep WHERE code=%(code)s", code=code) return ArrDep.construct(**row._asdict()) if row else None
def find_one_by_id(id: int) -> Optional[Task]: log.debug("Looking for task with id=%s", id) row = db.one("SELECT * FROM task WHERE id=%(id)s", id=id) return Task.construct(**row._asdict()) if row else None
def find_one_by_id(id: int) -> Optional[FlightPlan]: log.debug("Looking for schedule with id=%s", id) row = db.one("SELECT * FROM schedule WHERE id=%(id)s", id=id) return Schedule.construct(**row._asdict()) if row else None