MCPcopy Create free account
hub / github.com/dataease/SQLBot / _process_result_row

Method _process_result_row

backend/common/core/pagination.py:13–25  ·  view source on GitHub ↗
(self, row: Row)

Source from the content-addressed store, hash-verified

11 def __init__(self, session: Session):
12 self.session = session
13 def _process_result_row(self, row: Row) -> Dict[str, Any]:
14 result_dict = {}
15 if isinstance(row, int):
16 return {'id': row}
17 if isinstance(row, SQLModel) and not hasattr(row, '_fields'):
18 return row.model_dump()
19 for item, key in zip(row, row._fields):
20 if isinstance(item, SQLModel):
21 result_dict.update(item.model_dump())
22 else:
23 result_dict[key] = item
24
25 return result_dict
26 async def paginate(
27 self,
28 stmt: Union[Select, SelectOfScalar, Type[ModelT]],

Callers 1

paginateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected