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

Function installAndLoadHttpfsForRemoteInit

tools/shell/shell_runner.cpp:94–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void 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
115int main(int argc, char* argv[]) {
116 args::ArgumentParser parser("Lbug shell");

Callers 1

mainFunction · 0.85

Calls 7

isHttpfsLoadedFunction · 0.85
moveNextResultMethod · 0.80
whatMethod · 0.80
queryMethod · 0.45
isSuccessMethod · 0.45
getErrorMessageMethod · 0.45
hasNextQueryResultMethod · 0.45

Tested by

no test coverage detected