Package skytools :: Module quoting
[frames] | no frames]

Module quoting

source code

Various helpers for string quoting/unquoting.

Functions
 
quote_literal(s)
Quote a literal value for SQL.
source code
 
quote_copy(s)
Quoting for copy command.
source code
 
quote_bytea_raw(s)
Quoting for bytea parser.
source code
 
quote_bytea_literal(s)
Quote bytea for regular SQL.
source code
 
quote_bytea_copy(s)
Quote bytea for COPY.
source code
 
quote_statement(sql, dict)
Quote whose statement.
source code
 
quote_json(s)
JSON style quoting.
source code
 
db_urlencode(dict)
Database specific urlencode.
source code
 
db_urldecode(qs)
Database specific urldecode.
source code
 
unescape(val)
Removes C-style escapes from string.
source code
 
unescape_copy(val)
Removes C-style escapes, also converts "\N" to None.
source code
Function Details

quote_literal(s)

source code 

Quote a literal value for SQL.

Surronds it with single-quotes.

quote_statement(sql, dict)

source code 

Quote whose statement.

Data values are taken from dict.

db_urlencode(dict)

source code 

Database specific urlencode.

Encode None as key without '='. That means that in "foo&bar=", foo is NULL and bar is empty string.

db_urldecode(qs)

source code 

Database specific urldecode.

Decode key without '=' as None. This also does not support one key several times.