From: Peter Rabbitson Date: Fri, 27 Feb 2009 01:43:18 +0000 (+0000) Subject: We already depend on latest SQLA - remove all references to >= 1.50 - it will only... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20ea616f0157ae01c3af89ce6faa04e1da8248f4;p=dbsrgits%2FDBIx-Class-Historic.git We already depend on latest SQLA - remove all references to >= 1.50 - it will only add to the confusion --- diff --git a/Changes b/Changes index 02c6051..5c90996 100644 --- a/Changes +++ b/Changes @@ -32,9 +32,8 @@ Revision history for DBIx::Class (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) diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 00c28e9..c02e477 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -1381,10 +1381,10 @@ C key in the final hash as shown above. =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 and -L 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 and L family of +methods: $resultset->create({ numbers => [1, 2, 3] diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 233597e..e1cf9c2 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2555,22 +2555,26 @@ These are in no particular order: =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 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 enabled (see -L) 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 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 diff --git a/t/72pg.t b/t/72pg.t index 45e614f..cdf2178 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -130,10 +130,7 @@ like($artistid_defval, 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], diff --git a/t/95sql_maker.t b/t/95sql_maker.t index 0f7dda8..48f66ac 100644 --- a/t/95sql_maker.t +++ b/t/95sql_maker.t @@ -20,10 +20,7 @@ my $schema = DBICTest->init_schema(); 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', { diff --git a/t/95sql_maker_quote.t b/t/95sql_maker_quote.t index 4fa987b..a7687f8 100644 --- a/t/95sql_maker_quote.t +++ b/t/95sql_maker_quote.t @@ -110,10 +110,7 @@ is_same_sql_bind( '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 @@ is_same_sql_bind( '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( [ { diff --git a/t/resultset/as_query.t b/t/resultset/as_query.t index 5071f0c..7f4c738 100644 --- a/t/resultset/as_query.t +++ b/t/resultset/as_query.t @@ -7,12 +7,7 @@ use Data::Dumper; 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; diff --git a/t/search/subquery.t b/t/search/subquery.t index 2abf1a3..e6bcccf 100644 --- a/t/search/subquery.t +++ b/t/search/subquery.t @@ -7,12 +7,7 @@ use Data::Dumper; 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;