MCPcopy Index your code
hub / github.com/dbcli/mycli / execute

Method execute

test/pytests/test_special_llm.py:426–444  ·  view source on GitHub ↗
(self, query: str)

Source from the content-addressed store, hash-verified

424 self._row: tuple[int, str] | None = None
425
426 def execute(self, query: str) -> None:
427 self.executed.append(query)
428 if "information_schema.columns" in query:
429 self._rows = [("orders(id int)",), ("users(name text)",)]
430 return
431 if query == "SHOW TABLES":
432 self._rows = [("orders",), ("broken",), ("empty",)]
433 return
434 if "`orders`" in query:
435 self.description = [("id", None), ("name", None)]
436 self._row = (1, "alice")
437 return
438 if "`broken`" in query:
439 raise RuntimeError("bad table")
440 if "`empty`" in query:
441 self.description = [("id", None)]
442 self._row = None
443 return
444 raise AssertionError(f"unexpected query: {query}")
445
446 def fetchall(self) -> list[tuple[str]]:
447 return self._rows

Callers 15

_probe_doris_versionMethod · 0.45
runMethod · 0.45
tablesMethod · 0.45
table_columnsMethod · 0.45
enum_valuesMethod · 0.45
foreign_keysMethod · 0.45
databasesMethod · 0.45
functionsMethod · 0.45
proceduresMethod · 0.45
character_setsMethod · 0.45
collationsMethod · 0.45
show_candidatesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected