MCPcopy Create free account
hub / github.com/dbcli/mycli / _on_completions_refreshed

Method _on_completions_refreshed

mycli/client_query.py:59–72  ·  view source on GitHub ↗

Swap the completer object in cli with the newly created completer.

(self, new_completer: SQLCompleter)

Source from the content-addressed store, hash-verified

57 return [SQLResult(status="Auto-completion refresh started in the background.")]
58
59 def _on_completions_refreshed(self, new_completer: SQLCompleter) -> None:
60 """Swap the completer object in cli with the newly created completer."""
61 with self._completer_lock:
62 new_completer.copy_other_schemas_from(self.completer, exclude=new_completer.dbname)
63 self.completer = new_completer
64
65 if self.prompt_session:
66 # After refreshing, redraw the CLI to clear the statusbar
67 # "Refreshing completions..." indicator
68 self.prompt_session.app.invalidate()
69
70 # Kick off background prefetch for any extra schemas configured
71 # via ``prefetch_schemas_mode`` so users get cross-schema completions.
72 self.schema_prefetcher.start_configured()
73
74 def run_query(
75 self,

Calls 2

start_configuredMethod · 0.80