From: Dagfinn Ilmari Mannsåker Date: Tue, 23 Jun 2015 10:32:32 +0000 (+0100) Subject: Fix ORDER BY clause type in synopsis and where() header X-Git-Tag: v1.81_01~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85783f3cb864fd3a3a13d2054e1c6608e21f0675;p=dbsrgits%2FSQL-Abstract.git Fix ORDER BY clause type in synopsis and where() header The ORDER BY clause can be either a string, stringref, arrayref or hashref, so don't imply it has to be an arrayref in the docs. --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index d213115..a662631 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1675,7 +1675,7 @@ SQL::Abstract - Generate SQL from Perl data structures my $sql = SQL::Abstract->new; - my($stmt, @bind) = $sql->select($source, \@fields, \%where, \@order); + my($stmt, @bind) = $sql->select($source, \@fields, \%where, $order); my($stmt, @bind) = $sql->insert($table, \%fieldvals || \@values); @@ -1688,7 +1688,7 @@ SQL::Abstract - Generate SQL from Perl data structures $sth->execute(@bind); # Just generate the WHERE clause - my($stmt, @bind) = $sql->where(\%where, \@order); + my($stmt, @bind) = $sql->where(\%where, $order); # Return values in the same order, for hashed queries # See PERFORMANCE section for more details @@ -2153,7 +2153,7 @@ for details. This takes a table name and optional hashref L. It returns an SQL DELETE statement and list of bind values. -=head2 where(\%where, \@order) +=head2 where(\%where, $order) This is used to generate just the WHERE clause. For example, if you have an arbitrary data structure and know what the @@ -2760,7 +2760,7 @@ This would create: @bind = ('10'); Note that you must pass the bind values in the same format as they are returned -by L. This means that if you set L +by L. This means that if you set L to C, you must provide the bind values in the C<< [ column_meta => value ] >> format, where C is an opaque scalar value; most commonly the column name, but you can use any scalar value