| 447 | } |
| 448 | |
| 449 | EmbeddedShell::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 | |
| 470 | std::string decodeEscapeSequences(const std::string& input) { |
| 471 | std::regex unicodeRegex(R"(\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8}))"); |
nothing calls this directly
no test coverage detected