MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / get_rows

Method get_rows

database/PostgreSQL.py:318–334  ·  view source on GitHub ↗
(self, tablename:str, limit:int=10)

Source from the content-addressed store, hash-verified

316 return result
317
318 def get_rows(self, tablename:str, limit:int=10)->Result:
319 result = Result(table_name=tablename)
320 sentence = f"Select * from {tablename} LIMIT {limit}"
321 rows = self._select(sentence, showColumns=True)
322 for col in list(rows[0].keys()):
323 if col != Settings.checksum_column:
324 result.headers.append(col)
325
326 for item in rows:
327 items = []
328 for key in item:
329 if key != Settings.checksum_column:
330 items.append(item[key])
331
332 result.rows.append(items)
333
334 return result
335

Callers

nothing calls this directly

Calls 4

_selectMethod · 0.95
ResultClass · 0.90
keysMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected