[Bast-commits] r5570 -
DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage
michaelr at dev.catalyst.perl.org
michaelr at dev.catalyst.perl.org
Fri Feb 20 04:49:08 GMT 2009
Author: michaelr
Date: 2009-02-20 04:49:06 +0000 (Fri, 20 Feb 2009)
New Revision: 5570
Modified:
DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI.pm
Log:
added support for from => $rs->as_query
Modified: DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI.pm 2009-02-20 04:43:22 UTC (rev 5569)
+++ DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI.pm 2009-02-20 04:49:06 UTC (rev 5570)
@@ -259,10 +259,20 @@
return join('', @sqlf);
}
+sub _bind_to_sql {
+ my $self = shift;
+ my $arr = shift;
+ my $sql = shift @$$arr;
+ $sql =~ s/\?/$self->_quote((shift @$$arr)->[1])/eg;
+ return $sql
+}
+
sub _make_as {
my ($self, $from) = @_;
- return join(' ', map { (ref $_ eq 'SCALAR' ? $$_ : $self->_quote($_)) }
- reverse each %{$self->_skip_options($from)});
+ return join(' ', map { (ref $_ eq 'SCALAR' ? $$_
+ : ref $_ eq 'REF' ? $self->_bind_to_sql($_)
+ : $self->_quote($_))
+ } reverse each %{$self->_skip_options($from)});
}
sub _skip_options {
More information about the Bast-commits
mailing list