[Bast-commits] r5663 - in DBIx-Class/0.08/trunk: . lib/DBIx/Class
lib/DBIx/Class/Manual t t/resultset t/search
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Feb 27 01:43:18 GMT 2009
Author: ribasushi
Date: 2009-02-27 01:43:18 +0000 (Fri, 27 Feb 2009)
New Revision: 5663
Modified:
DBIx-Class/0.08/trunk/Changes
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
DBIx-Class/0.08/trunk/t/72pg.t
DBIx-Class/0.08/trunk/t/95sql_maker.t
DBIx-Class/0.08/trunk/t/95sql_maker_quote.t
DBIx-Class/0.08/trunk/t/resultset/as_query.t
DBIx-Class/0.08/trunk/t/search/subquery.t
Log:
We already depend on latest SQLA - remove all references to >= 1.50 - it will only add to the confusion
Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/Changes 2009-02-27 01:43:18 UTC (rev 5663)
@@ -32,9 +32,8 @@
(http://msdn.microsoft.com/en-us/library/ms190315.aspx)
- an sqlt_deploy_hook can now be shared between result sources using
a configurable callback trigger
- - new order_by => { -desc => 'colname' } syntax supported with
- SQLA >= 1.50
- - PG array datatype supported with SQLA >= 1.50
+ - new order_by => { -desc => 'colname' } syntax supported
+ - PG array datatype supported
- insert should use store_column, not set_column to avoid marking
clean just-stored values as dirty. New test for this (groditi)
- regression test for source_name (groditi)
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-02-27 01:43:18 UTC (rev 5663)
@@ -1381,10 +1381,10 @@
=head2 Working with PostgreSQL array types
-If your SQL::Abstract version (>= 1.50) supports it, you can assign to
-PostgreSQL array values by passing array references in the C<\%columns>
-(C<\%vals>) hashref of the L<DBIx::Class::ResultSet/create> and
-L<DBIx::Class::Row/update> family of methods:
+You can also assign values to PostgreSQL array columns by passing array
+references in the C<\%columns> (C<\%vals>) hashref of the
+L<DBIx::Class::ResultSet/create> and L<DBIx::Class::Row/update> family of
+methods:
$resultset->create({
numbers => [1, 2, 3]
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2009-02-27 01:43:18 UTC (rev 5663)
@@ -2555,23 +2555,27 @@
=over 4
-=item Value: ($order_by | \@order_by)
+=item Value: ( $order_by | \@order_by | \%order_by )
=back
-Which column(s) to order the results by. This is currently passed
-through directly to SQL, so you can give e.g. C<year DESC> for a
-descending order on the column `year'.
+Which column(s) to order the results by. If a single column name, or
+an arrayref of names is supplied, the argument is passed through
+directly to SQL. The hashref syntax allows for connection-agnostic
+specification of ordering direction:
-Please note that if you have C<quote_char> enabled (see
-L<DBIx::Class::Storage::DBI/connect_info>) you will need to do C<\'year DESC' > to
-specify an order. (The scalar ref causes it to be passed as raw sql to the DB,
-so you will need to manually quote things as appropriate.)
+ For descending order:
-If your L<SQL::Abstract> version supports it (>=1.50), you can also use
-C<{-desc => 'year'}>, which takes care of the quoting for you. This is the
-recommended syntax.
+ order_by => { -desc => [qw/col1 col2 col3/] }
+ For explicit ascending order:
+
+ order_by => { -asc => 'col' }
+
+The old scalarref syntax (i.e. order_by => \'year DESC') is still
+supported, although you are strongly encouraged to use the hashref
+syntax as outlined above.
+
=head2 columns
=over 4
Modified: DBIx-Class/0.08/trunk/t/72pg.t
===================================================================
--- DBIx-Class/0.08/trunk/t/72pg.t 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/t/72pg.t 2009-02-27 01:43:18 UTC (rev 5663)
@@ -130,10 +130,7 @@
is_deeply($type_info, $test_type_info,
'columns_info_for - column data types');
-SKIP: {
- skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 4
- if $SQL::Abstract::VERSION < 1.49;
-
+{
lives_ok {
$schema->resultset('ArrayTest')->create({
arrayfield => [1, 2],
Modified: DBIx-Class/0.08/trunk/t/95sql_maker.t
===================================================================
--- DBIx-Class/0.08/trunk/t/95sql_maker.t 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/t/95sql_maker.t 2009-02-27 01:43:18 UTC (rev 5663)
@@ -20,10 +20,7 @@
my $sql_maker = $schema->storage->sql_maker;
-SKIP: {
- skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 2
- if $SQL::Abstract::VERSION < 1.49;
-
+{
my ($sql, @bind) = $sql_maker->insert(
'lottery',
{
Modified: DBIx-Class/0.08/trunk/t/95sql_maker_quote.t
===================================================================
--- DBIx-Class/0.08/trunk/t/95sql_maker_quote.t 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/t/95sql_maker_quote.t 2009-02-27 01:43:18 UTC (rev 5663)
@@ -110,10 +110,7 @@
'scalar ORDER BY okay (multiple values)'
);
-SKIP: {
- skip "SQL::Abstract < 1.49 does not support hashrefs in order_by", 2
- if $SQL::Abstract::VERSION < 1.49;
-
+{
($sql, @bind) = $sql_maker->select(
[
{
@@ -236,10 +233,7 @@
'quoted table names for UPDATE'
);
-SKIP: {
- skip "select attr with star does not work in SQL::Abstract < 1.49", 1
- if $SQL::Abstract::VERSION < 1.49;
-
+{
($sql, @bind) = $sql_maker->select(
[
{
Modified: DBIx-Class/0.08/trunk/t/resultset/as_query.t
===================================================================
--- DBIx-Class/0.08/trunk/t/resultset/as_query.t 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/t/resultset/as_query.t 2009-02-27 01:43:18 UTC (rev 5663)
@@ -7,12 +7,7 @@
use Test::More;
-BEGIN {
- eval "use SQL::Abstract 1.49";
- plan $@
- ? ( skip_all => "Needs SQLA 1.49+" )
- : ( tests => 4 );
-}
+plan ( tests => 4 );
use lib qw(t/lib);
use DBICTest;
Modified: DBIx-Class/0.08/trunk/t/search/subquery.t
===================================================================
--- DBIx-Class/0.08/trunk/t/search/subquery.t 2009-02-27 01:24:37 UTC (rev 5662)
+++ DBIx-Class/0.08/trunk/t/search/subquery.t 2009-02-27 01:43:18 UTC (rev 5663)
@@ -7,12 +7,7 @@
use Test::More;
-BEGIN {
- eval "use SQL::Abstract 1.49";
- plan $@
- ? ( skip_all => "Needs SQLA 1.49+" )
- : ( tests => 7 );
-}
+plan ( tests => 7 );
use lib qw(t/lib);
use DBICTest;
More information about the Bast-commits
mailing list