Bugzilla::DB::QuoteIdentifier
my %q; tie %q, 'Bugzilla::DB::QuoteIdentifier', db => Bugzilla->dbh; is("this is $q{something}", 'this is ' . Bugzilla->dbh->quote_identifier('something'));
Bugzilla has many strings with bare sql column names or table names. Sometimes, as in the case of MySQL 8, formerly unreserved keywords can become reserved.
This module provides a shortcut for quoting identifiers in strings by way of overloading a hash so that we can easily call quote_identifier
inside double-quoted strings.
This class can be used as a tied hash, which is only done to allow quoting identifiers inside double-quoted strings.
Exmaple:
my $qi = Bugzilla->dbh->qi; my $sql = "SELECT $qi->{bug_id} FROM $qi->{bugs}";
Returns the quoted identifier for the given key, this just calls quote_identifier
on the database handle.
This returns nothing, as this tied hash has no keys or values.
This returns nothing, as this tied hash has no keys or values.
This always returns true, as this tied hash has no keys or values but technically every key exists.
This always returns true, as this tied hash has no keys or values but technically every key can be deleted.
This is a weak reference to the database handle that is used to quote identifiers.