Quoter

Quoter handles value quoting, unquoting, escaping, etc.

Summary
QuoterQuoter handles value quoting, unquoting, escaping, etc.
Functions
new
quoteQuote values in backticks.
quote_valQuote a value for use in a SQL statement.
split_unquoteSplit and unquote a table name.
literal_likeEscape LIKE wildcard % and _.
join_quoteJoin and backtick-quote a database name with a table name.

Functions

new

sub new

Parameters

%argsArguments

Returns

Quoter object

quote

sub quote

Quote values in backticks.

Parameters

@valsList of values to quote

Returns

Array of backtick-quoted values

quote_val

sub quote_val

Quote a value for use in a SQL statement.  Examples: undef = “NULL”, empty string = ‘’, etc.

Parameters

$valValue to quote

Returns

Quoted value

split_unquote

sub split_unquote

Split and unquote a table name.  The table name can be database-qualified or not, like `db`.`table`.  The table name can be backtick-quoted or not.

Parameters

$db_tblTable name
$default_dbDefault database name to return if $db_tbl is not database-qualified

Returns

Array: unquoted database (possibly undef), unquoted table

See Also

join_quote

literal_like

sub literal_like

Escape LIKE wildcard % and _.

Parameters

$likeLIKE value to escape

Returns

Escaped LIKE value

join_quote

sub join_quote

Join and backtick-quote a database name with a table name.  This sub does the opposite of split_unquote.

Parameters

$default_dbDefault database name to use if $db_tbl is not database-qualified
$db_tblTable name, optionally database-qualified, optionally quoted

Returns

Backtick-quoted, database-qualified table like `database`.`table`

See Also

split_unquote

sub new
sub quote
Quote values in backticks.
sub quote_val
Quote a value for use in a SQL statement.
sub split_unquote
Split and unquote a table name.
sub literal_like
Escape LIKE wildcard % and _.
sub join_quote
Join and backtick-quote a database name with a table name.
Close