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

Method search_columns

database/PostgreSQL.py:309–316  ·  view source on GitHub ↗
(self, filter:str,operator:str='ilike', logic_operator:str='or')

Source from the content-addressed store, hash-verified

307 return result
308
309 def search_columns(self, filter:str,operator:str='ilike', logic_operator:str='or') -> Result:
310 result = Result(headers=['table_name','column_name'])
311 sentence = self._get_sentence(filter, operator, logic_operator).format(object_name='table_name')
312 columns = self._select(f"Select table_name,column_name from information_schema.columns where (column_name ilike {sentence}) and table_schema='public'", showColumns=True)
313 if columns:
314 for col in columns:
315 result.rows.append([col["table_name"], col["column_name"]])
316 return result
317
318 def get_rows(self, tablename:str, limit:int=10)->Result:
319 result = Result(table_name=tablename)

Callers

nothing calls this directly

Calls 5

_get_sentenceMethod · 0.95
_selectMethod · 0.95
ResultClass · 0.90
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected