MCPcopy Create free account
hub / github.com/firebase/firebase-tools / mainShellLoop

Function mainShellLoop

src/commands/dataconnect-sql-shell.ts:66–83  ·  view source on GitHub ↗
(conn: pg.PoolClient)

Source from the content-addressed store, hash-verified

64}
65
66async function mainShellLoop(conn: pg.PoolClient) {
67 while (true) {
68 const query = await promptForQuery();
69 if (query.toLowerCase() === ".exit") {
70 break;
71 }
72
73 if (query === "") {
74 continue;
75 }
76
77 if (await confirmDangerousQuery(query)) {
78 await interactiveExecuteQuery(query, conn);
79 } else {
80 logger.info(clc.yellow("Query cancelled."));
81 }
82 }
83}
84
85type ShellOptions = Options & { service?: string; location?: string };
86

Callers 1

Calls 3

confirmDangerousQueryFunction · 0.90
interactiveExecuteQueryFunction · 0.90
promptForQueryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…