X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FNoBindVars.pm;h=4ff6925b18840fcc30ce933fd0c9dc726dae656f;hb=ac2803efd625dc19dd55756dc3483e3a973e0f45;hp=f119013890ef4094d245112d8a20fbbf66c40066;hpb=3885cff6485aba6a4708efb7f98877bc8e5d4369;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm index f119013..4ff6925 100644 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@ -5,6 +5,35 @@ use warnings; use base 'DBIx::Class::Storage::DBI'; +=head1 NAME + +DBIx::Class::Storage::DBI::NoBindVars - Sometime DBDs have poor to no support for bind variables + +=head1 DESCRIPTION + +This class allows queries to work when the DBD or underlying library does not +support the usual C placeholders, or at least doesn't support them very +well, as is the case with L + +=head1 METHODS + +=head2 sth + +Uses C instead of the usual C, seeing as we can't cache very effectively without bind variables. + +=cut + +sub sth { + my ($self, $sql) = @_; + return $self->dbh->prepare($sql); +} + +=head2 _execute + +Manually subs in the values for the usual C placeholders before calling L on the generated SQL. + +=cut + sub _execute { my ($self, $op, $extra_bind, $ident, @args) = @_; my ($sql, @bind) = $self->sql_maker->$op($ident, @args); @@ -45,27 +74,16 @@ sub _execute { return (wantarray ? ($rv, $sth, @bind) : $rv); } -1; - -=head1 NAME - -DBIx::Class::Storage::DBI::NoBindVars - Sometime DBDs have poor to no support for bind variables - -=head1 SYNOPSIS - -=head1 DESCRIPTION - -This class allows queries to work when the DBD or underlying library does not -support the usual C placeholders, or at least doesn't support them very -well, as is the case with L - =head1 AUTHORS Brandon Black -trym + +Trym Skaar =head1 LICENSE You may distribute this code under the same terms as Perl itself. =cut + +1;