MCPcopy
hub / github.com/dbcli/pgcli / search_path

Method search_path

pgcli/pgexecute.py:480–493  ·  view source on GitHub ↗

Returns the current search path as a list of schema names

(self)

Source from the content-addressed store, hash-verified

478 return title, None, None, cur.statusmessage
479
480 def search_path(self):
481 """Returns the current search path as a list of schema names"""
482
483 try:
484 with self.conn.cursor() as cur:
485 _logger.debug("Search path query. sql: %r", self.search_path_query)
486 cur.execute(self.search_path_query)
487 return [x[0] for x in cur.fetchall()]
488 except psycopg.ProgrammingError:
489 fallback = "SELECT * FROM current_schemas(true)"
490 with self.conn.cursor() as cur:
491 _logger.debug("Search path query. sql: %r", fallback)
492 cur.execute(fallback)
493 return cur.fetchone()[0]
494
495 def view_definition(self, spec):
496 """Returns the SQL defining views described by `spec`"""

Callers 3

refresh_schemataFunction · 0.80
execute_commandMethod · 0.80

Calls 3

fetchallMethod · 0.80
fetchoneMethod · 0.80
executeMethod · 0.45