module PG::EscapeHelper
Extended Modules
Direct including types
Defined in:
pg/escape_helper.crInstance Method Summary
-
#escape_identifier(str)
#escape_identifierescapes a string for use as an SQL identifier, such as a table, column, or function name. -
#escape_literal(slice : Slice(UInt8))
#escape_literalescapes binary data suitable for use with the BYTEA type. -
#escape_literal(str)
#escape_literalescapes a string for use within an SQL command.
Instance Method Detail
#escape_identifier escapes a string for use as an SQL identifier, such
as a table, column, or function name. This is useful when a user-supplied
identifier might contain special characters that would otherwise not be
interpreted as part of the identifier by the SQL parser, or when the
identifier might contain upper case characters whose case should be
preserved.
#escape_literal escapes binary data suitable for use with the BYTEA type.
#escape_literal escapes a string for use within an SQL command. This is
useful when inserting data values as literal constants in SQL commands.
Certain characters (such as quotes and backslashes) must be escaped to
prevent them from being interpreted specially by the SQL parser.
PQescapeLiteral performs this operation.
Note that it is not necessary nor correct to do escaping when a data
value is passed as a separate parameter in #exec