X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSetColumn.pm;h=2a7ce9756dba4d53648e57b6b7f1841a7f99975f;hb=03834f775f371dd68f314f2648236700e7eb4404;hp=5e8e7277878b344170fa2fa9c00ef91f86610e53;hpb=36d80a6bc4fd382919d7f74ec53aec5c2da5fca2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSetColumn.pm b/lib/DBIx/Class/ResultSetColumn.pm index 5e8e727..2a7ce97 100644 --- a/lib/DBIx/Class/ResultSetColumn.pm +++ b/lib/DBIx/Class/ResultSetColumn.pm @@ -66,56 +66,11 @@ sub new { Returns the SQL query and bind vars associated with the invocant. -=cut - -sub as_query { return shift->_resultset->as_query } - -=head2 as_subselect - -=over 4 - -=item Arguments: none - -=item Return Value: \[ $sql, @bind ] - -=back - -Returns the SQL query and bind vars associated with the invocant. - -The SQL will be wrapped in parentheses, ready for use as a subselect. +This is generally used as the RHS for a subquery. =cut -sub as_subselect { - my $self = shift; - my $arr = ${$self->as_query(@_)}; - $arr->[0] = '( ' . $arr->[0] . ' )'; - return \$arr; -} - -=head2 as_query - -=over 4 - -=item Arguments: none - -=item Return Value: $sql - -=back - -Returns the SQL query associated with the invocant. All bind vars -will have been bound using C<< DBI->quote() >>. - -=cut - -sub as_sql { - my $self = shift; - my $arr = ${$self->as_query(@_)}; - my $sql = shift @$arr; - my $dbh = $self->_resultset->result_source->schema->storage->dbh; - $sql =~ s/\?/$dbh->quote((shift @$arr)->[1])/eg; - return $sql -} +sub as_query { return shift->_resultset->as_query } =head2 next