MCPcopy Index your code
hub / github.com/dbcli/pgcli / get_table_matches

Method get_table_matches

pgcli/pgcompleter.py:784–793  ·  view source on GitHub ↗
(self, suggestion, word_before_cursor, alias=False)

Source from the content-addressed store, hash-verified

782 return Candidate(item, synonyms=synonyms, prio2=prio2, display=display)
783
784 def get_table_matches(self, suggestion, word_before_cursor, alias=False):
785 tables = self.populate_schema_objects(suggestion.schema, "tables")
786 tables.extend(SchemaObject(tbl.name) for tbl in suggestion.local_tables)
787
788 # Unless we're sure the user really wants them, don't suggest the
789 # pg_catalog tables that are implicitly on the search path
790 if not suggestion.schema and (not word_before_cursor.startswith("pg_")):
791 tables = [t for t in tables if not t.name.startswith("pg_")]
792 tables = [self._make_cand(t, alias, suggestion) for t in tables]
793 return self.find_matches(word_before_cursor, tables, meta="table")
794
795 def get_table_formats(self, _, word_before_cursor):
796 formats = TabularOutputFormatter().supported_formats

Callers 1

Calls 4

_make_candMethod · 0.95
find_matchesMethod · 0.95
SchemaObjectFunction · 0.85

Tested by

no test coverage detected