1 package DBIx::Class::Storage::DBI::NoBindVars;
6 use base 'DBIx::Class::Storage::DBI';
10 DBIx::Class::Storage::DBI::NoBindVars - Sometime DBDs have poor to no support for bind variables
14 This class allows queries to work when the DBD or underlying library does not
15 support the usual C<?> placeholders, or at least doesn't support them very
16 well, as is the case with L<DBD::Sybase>
22 Uses C<prepare> instead of the usual C<prepare_cached>, seeing as we can't cache very effectively without bind variables.
27 my ($self, $dbh, $sql) = @_;
31 =head2 _prep_for_execute
33 Manually subs in the values for the usual C<?> placeholders.
37 sub _prep_for_execute {
39 my ($sql, @bind) = $self->next::method(@_);
41 $sql =~ s/\?/$self->_dbh->quote($_)/e for (@bind);
48 Brandon Black <blblack@gmail.com>
50 Trym Skaar <trym@tryms.no>
54 You may distribute this code under the same terms as Perl itself.