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

Method canReuseCachedPlanWith

src/main/prepared_statement.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool PreparedStatement::canReuseCachedPlanWith(
53 const std::unordered_map<std::string, std::unique_ptr<Value>>& inputParams) const {
54 if (!unknownParameters.empty()) {
55 return false;
56 }
57 for (auto& [key, value] : inputParams) {
58 if (!parameterMap.contains(key)) {
59 return false;
60 }
61 if (parameterMap.at(key)->getDataType() != value->getDataType()) {
62 return false;
63 }
64 }
65 return true;
66}
67
68static void validateParam(const std::string& paramName, Value* newVal, Value* oldVal) {
69 if (newVal->getDataType().getLogicalTypeID() == LogicalTypeID::POINTER &&

Callers 1

executeWithParamsMethod · 0.80

Calls 3

getDataTypeMethod · 0.80
emptyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected