You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Introduces an extensible command registrating/handling system to SqlQueryRunner, replacing hardcoded if-else branches in Console with a flexible registration pattern.
**Key Changes:**
- Added `CommandResult` with `outcomes` vector to support multiple statement results
- Added `StatementOutcome` struct with message, data, and timing fields
- Move `Timing` struct and `time()` template to SqlQueryRunner
- Implemented prefix-based command matching with longest-match-first semantics
- Commands (exit, quit, help, savehistory, clearhistory, session) now register via `registerCommands()`
- `handleCommand()` dispatches to registered handlers or the SQL executor
- Console now uses `printOutcomes()` helper to reduce code duplication
This enables KoskiSqlRunner and other subclasses to customize command behavior while reusing the console infrastructure.
Differential Revision: D90933335
if (command.starts_with("exit") || command.starts_with("quit")) {
338
-
break;
339
-
}
340
-
341
-
if (command.starts_with("help")) {
342
-
staticconstchar* helpText =
343
-
"Axiom Interactive SQL\n\n"
344
-
"Type SQL and end with ';'.\n"
345
-
"To set a flag, type 'flag <gflag_name> = <value>;' Leave a space on either side of '='.\n\n"
346
-
"Useful flags:\n\n"
347
-
"num_workers - Make a distributed plan for this many workers. Runs it in-process with remote exchanges with serialization and passing data in memory. If num_workers is 1, makes single node plans without remote exchanges.\n\n"
348
-
"num_drivers - Specifies the parallelism for workers. This many threads per pipeline per worker.\n\n";
286
+
// Try registered commands first, then execute SQL.
0 commit comments