MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / EmbeddedShell

Method EmbeddedShell

tools/shell/embedded_shell.cpp:449–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449EmbeddedShell::EmbeddedShell(std::shared_ptr<Database> database, std::shared_ptr<Connection> conn,
450 ShellConfig& shellConfig) {
451 path_to_history = shellConfig.path_to_history;
452 linenoiseHistoryLoad(path_to_history);
453 linenoiseSetCompletionCallback(completion);
454 this->database = database;
455 this->conn = conn;
456 globalConnection = conn.get();
457 maxRowSize = shellConfig.maxRowSize;
458 maxPrintWidth = shellConfig.maxPrintWidth;
459 printer = std::move(shellConfig.printer);
460 stats = shellConfig.stats;
461 catalogVersion = database->catalog->getVersion();
462 updateTableNames();
463 updateFunctionAndTypeNames();
464 auto sigResult = std::signal(SIGINT, interruptHandler);
465 if (sigResult == SIG_ERR) {
466 throw std::runtime_error("Error: Failed to set signal handler");
467 }
468}
469
470std::string decodeEscapeSequences(const std::string& input) {
471 std::regex unicodeRegex(R"(\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8}))");

Callers

nothing calls this directly

Calls 4

linenoiseHistoryLoadFunction · 0.85
getMethod · 0.45
getVersionMethod · 0.45

Tested by

no test coverage detected