Escape a string value for safe embedding in a SQL single-quoted literal
(used in RunView ExtraFilter strings).
Replaces every single-quote with two single-quotes, which is the ANSI SQL
standard escaping mechanism supported by both SQL Server and PostgreSQL.
Do not use for identifier names (table/column names) — those require
bracket or double-quote quoting and are handled by SchemaEngine's
ValidateIdentifier().
Parameters
value: string
Returns string
Example
// User-supplied name embedded in a RunView filter constfilter = `Name = '${escapeSqlLiteral(entityName)}'`;
Escape a string value for safe embedding in a SQL single-quoted literal (used in RunView
ExtraFilterstrings).Replaces every single-quote with two single-quotes, which is the ANSI SQL standard escaping mechanism supported by both SQL Server and PostgreSQL.
Do not use for identifier names (table/column names) — those require bracket or double-quote quoting and are handled by SchemaEngine's
ValidateIdentifier().