MCPcopy Create free account
hub / github.com/activeloopai/hivemind / sqlStr

Function sqlStr

src/utils/sql.ts:12–18  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

10 * Handles: single quotes, backslashes, NUL bytes, and control characters.
11 */
12export function sqlStr(value: string): string {
13 return value
14 .replace(/\\/g, "\\\\")
15 .replace(/'/g, "''")
16 .replace(/\0/g, "")
17 .replace(/[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
18}
19
20/**
21 * Escape a string for use inside a SQL LIKE/ILIKE pattern.

Callers 15

sqlLikeFunction · 0.70
upsertRowSqlMethod · 0.50
updateColumnsMethod · 0.50
createIndexMethod · 0.50
buildIntrospectionSqlFunction · 0.50
pickResumeBriefFunction · 0.50
buildPathConditionFunction · 0.50
goalAddFunction · 0.50
goalListFunction · 0.50
goalGetFunction · 0.50
goalProgressFunction · 0.50
kpiAddFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected