Skip Menu |

This queue is for tickets about the SQL-Abstract CPAN distribution.

Report information
The Basics
Id: 58146
Status: rejected
Priority: 0/
Queue: SQL-Abstract

People
Owner: Nobody in particular
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: AND method like where
I'd like to see an "and" method added like this. sub and { my ($self, $where, $order) = @_; my ($sql, @bind) = $self->_recurse_where($where); $sql = $sql ? $self->_sqlcase(' and ') . "( $sql )" : ''; if ($order) { $sql .= $self->_order_by($order); } return wantarray ? ($sql, @bind) : $sql; } This way I do not have to put my table joins into the where caluse.
On Fri Jun 04 17:26:07 2010, MRDVT wrote: Show quoted text
> I'd like to see an "and" method added like this. > > sub and { > my ($self, $where, $order) = @_; > my ($sql, @bind) = $self->_recurse_where($where); > $sql = $sql ? $self->_sqlcase(' and ') . "( $sql )" : ''; > if ($order) { > $sql .= $self->_order_by($order); > } > return wantarray ? ($sql, @bind) : $sql; > } > > > This way I do not have to put my table joins into the where caluse.
I am sorry, I don't quite follow what this does... Can you show an example invocation, demonstrating how this method would be used, and the resulting SQL?
On Fri Jun 04 17:26:07 2010, MRDVT wrote: Show quoted text
> I'd like to see an "and" method added like this. > > sub and { > my ($self, $where, $order) = @_; > my ($sql, @bind) = $self->_recurse_where($where); > $sql = $sql ? $self->_sqlcase(' and ') . "( $sql )" : ''; > if ($order) { > $sql .= $self->_order_by($order); > } > return wantarray ? ($sql, @bind) : $sql; > } > > > This way I do not have to put my table joins into the where caluse.
No reply from original reporter. Stalling for the time being.
On Fri Jun 04 17:26:07 2010, MRDVT wrote: Show quoted text
> I'd like to see an "and" method added like this. > > sub and { > my ($self, $where, $order) = @_; > my ($sql, @bind) = $self->_recurse_where($where); > $sql = $sql ? $self->_sqlcase(' and ') . "( $sql )" : ''; > if ($order) { > $sql .= $self->_order_by($order); > } > return wantarray ? ($sql, @bind) : $sql; > } > > > This way I do not have to put my table joins into the where caluse.
Closing ticket due to insufficient description and MIA-ed author.