MCPcopy
hub / github.com/questdb/questdb / substituteVariables

Method substituteVariables

compat/src/test/nodejs-postgres/runner.js:13–18  ·  view source on GitHub ↗
(text, variables)

Source from the content-addressed store, hash-verified

11 }
12
13 substituteVariables(text, variables) {
14 if (!text) return null;
15 return text.replace(/\${(\w+)}/g, (match, key) =>
16 variables[key] !== undefined ? variables[key] : match
17 );
18 }
19
20 adjustPlaceholderSyntax(query) {
21 // The postgres package uses $1, $2, etc. just like the pg package,

Callers 2

resolveParametersMethod · 0.95
executeStepMethod · 0.95

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected