| 92 | } |
| 93 | |
| 94 | void installAndLoadHttpfsForRemoteInit(const std::shared_ptr<Connection>& conn, |
| 95 | const std::string& initFile) { |
| 96 | if (LocalFileSystem::isLocalPath(initFile) || isHttpfsLoaded(conn)) { |
| 97 | return; |
| 98 | } |
| 99 | try { |
| 100 | auto result = conn->query("INSTALL httpfs; LOAD EXTENSION httpfs;"); |
| 101 | while (result != nullptr) { |
| 102 | if (!result->isSuccess()) { |
| 103 | std::cerr << "Warning: failed to auto-load httpfs for remote init file: " |
| 104 | << result->getErrorMessage() << '\n'; |
| 105 | return; |
| 106 | } |
| 107 | result = result->hasNextQueryResult() ? result->moveNextResult() : nullptr; |
| 108 | } |
| 109 | } catch (Exception& e) { |
| 110 | std::cerr << "Warning: failed to auto-load httpfs for remote init file: " << e.what() |
| 111 | << '\n'; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | int main(int argc, char* argv[]) { |
| 116 | args::ArgumentParser parser("Lbug shell"); |
no test coverage detected