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

Method setParameter

src/main/prepared_statement.cpp:98–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void PreparedStatement::setParameter(const std::string& name, Value value) {
99 if (!parameterMap.contains(name)) {
100 throw BinderException(std::format("Parameter {} not found.", name));
101 }
102 auto& oldValue = parameterMap.at(name);
103 if (oldValue->getDataType() != value.getDataType()) {
104 throw BinderException(std::format("Cannot update parameter {} with type {}. Expected {}.",
105 name, value.getDataType().toString(), oldValue->getDataType().toString()));
106 }
107 validateParam(name, &value, oldValue.get());
108 *oldValue = std::move(value);
109}
110
111PreparedStatement::~PreparedStatement() = default;
112

Callers 1

runCaseFunction · 0.80

Calls 5

validateParamFunction · 0.85
getDataTypeMethod · 0.80
containsMethod · 0.45
toStringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected