MCPcopy Create free account
hub / github.com/dolthub/doltgresql / EscapeSQLString

Function EscapeSQLString

postgres/parser/lex/encode.go:92–96  ·  view source on GitHub ↗

EscapeSQLString returns an escaped SQL representation of the given string. This is suitable for safely producing a SQL string valid for input to the parser.

(in string)

Source from the content-addressed store, hash-verified

90// string. This is suitable for safely producing a SQL string valid
91// for input to the parser.
92func EscapeSQLString(in string) string {
93 var buf bytes.Buffer
94 EncodeSQLString(&buf, in)
95 return buf.String()
96}
97
98// EncodeSQLStringWithFlags writes a string literal to buf. All
99// unicode and non-printable characters are escaped. flags controls

Callers 2

FormatMethod · 0.92
FormatMethod · 0.92

Calls 2

EncodeSQLStringFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected