DBIx::C...BindVars(3)
πΈ NAME πΈ
okay so bestie, you're on the DBIx::C...BindVars(3) page from User Contributed Perl Documentation π. The actual module in the spotlight is DBIx::Class::Storage::DBI::NoBindVars β sometime DBDs have poor to no support for bind variables. periodt.
π¦ DESCRIPTION π¦
This class is the iconic fix for when the DBD or underlying library does not support the usual "?" placeholders, or at least doesn't support them very well β as is the case with DBD::Sybase π. It allows queries to work anyway, and honestly? slay.
β¨ METHODS β¨
π
connect_info
We can't cache very effectively without bind variables, so this forces the "disable_sth_caching" setting to be turned on when the connect info is set. no cap, it's for our own good π«Ά.
π§ _prep_for_execute
Manually subs in the values for the usual "?" placeholders. That's the whole move, bestie π
.
π interpolate_unquoted
This method is called by "_prep_for_execute" for every column to figure out if its value should be quoted or not. The arguments are:
- the current column data type
- the actual bind value
The return value is interpreted like this:
trueβ do not quotefalseβ do quote
You should override this in your Storage::DBI::<database> subclass if your RDBMS does not like quotes around certain datatypes (e.g. Sybase and integer columns). The default method returns false, except for integer datatypes paired with values containing nothing but digits. iykyk β¨.
β οΈ WARNING!!! Always validate that the bind-value is valid for the current datatype. Otherwise you may very well open the door to SQL injection attacks. This is not a drill, bestie β SQL injection is giving villain arc π.
π _prep_interpolated_value
Given a datatype and the value to be inserted directly into a SQL query, this returns the necessary string to represent that value β by e.g. adding a '$' sign. It's literally the value's red-carpet outfit π
.
π₯ FURTHER QUESTIONS? π₯
Check the list of additional DBIC resources. iykyk π¦.
π COPYRIGHT AND LICENSE π
This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library.
That's the whole page, bestie π«Ά. This was perl v5.42.0, dated 2025-01-22 β mwah π.
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBIx-Class 0.082844-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms