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

Function getBoolCopyOption

src/binder/bind/copy/bind_copy_from.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26static bool getBoolCopyOption(const options_t& parsingOptions, const char* optionName,
27 bool defaultValue) {
28 const auto it = parsingOptions.find(optionName);
29 if (it == parsingOptions.end()) {
30 return defaultValue;
31 }
32 const auto& value = *it->second;
33 auto strValue = value.toString();
34 StringUtils::toUpper(strValue);
35 if (strValue == "TRUE" || strValue == "1") {
36 return true;
37 }
38 if (strValue == "FALSE" || strValue == "0") {
39 return false;
40 }
41 throw BinderException(
42 std::format("The type of copy parsing option {} must be a boolean.", optionName));
43}
44
45std::unique_ptr<BoundStatement> Binder::bindLegacyCopyRelGroupFrom(const Statement& statement) {
46 auto& copyFrom = statement.constCast<CopyFrom>();

Callers 2

bindCopyNodeFromInfoMethod · 0.85
bindCopyRelFromInfoMethod · 0.85

Calls 3

findMethod · 0.45
endMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected