MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / escapeValue

Method escapeValue

packages/db/src/clickhouse/query-builder.ts:128–147  ·  view source on GitHub ↗
(value: SqlParam)

Source from the content-addressed store, hash-verified

126
127 // Where methods
128 private escapeValue(value: SqlParam): string {
129 if (value === null) {
130 return 'NULL';
131 }
132 if (value instanceof Expression) {
133 return `(${value.toString()})`;
134 }
135 if (Array.isArray(value)) {
136 return `(${value.map((v) => this.escapeValue(v)).join(', ')})`;
137 }
138
139 if (
140 (typeof value === 'string' && this._dateValueRegex.test(value)) ||
141 value instanceof Date
142 ) {
143 return this.escapeDate(value);
144 }
145
146 return sqlstring.escape(value);
147 }
148
149 where(column: string, operator: Operator, value?: SqlParam): this {
150 if (this._skipNext) {

Callers 1

buildConditionMethod · 0.95

Calls 4

escapeDateMethod · 0.95
joinMethod · 0.80
toStringMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected