From: Rafael Kitover Date: Mon, 28 Sep 2009 09:31:38 +0000 (+0000) Subject: minor changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a9765c19a33187ad323e0eb685d38c08a97deaf;p=dbsrgits%2FDBIx-Class-Historic.git minor changes --- diff --git a/Changes b/Changes index 1c8160a..393c64c 100644 --- a/Changes +++ b/Changes @@ -1,18 +1,18 @@ Revision history for DBIx::Class - - Sybase bulk API support for populate() - Complete Sybase RDBMS support including: - Support for TEXT/IMAGE columns - Support for the 'money' datatype - - Transaction savepoints support - - DateTime inflation support - - Support for bind variables when connecting to a newer Sybase with - OpenClient libraries - - Support for connections via FreeTDS with CASTs for bind variables - when needed - - Support for interpolated variables with proper quoting when - connecting to an older Sybase and/or via FreeTDS + - Transaction savepoints support + - DateTime inflation support + - Support for bind variables when connecting to a newer Sybase with + OpenClient libraries + - Support for connections via FreeTDS with CASTs for bind variables + when needed + - Support for interpolated variables with proper quoting when + connecting to an older Sybase and/or via FreeTDS + - bulk API support for populate() 0.08112 2009-09-21 10:57:00 (UTC) - Remove the recommends from Makefile.PL, DBIx::Class is not diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 60da1ca..d5dc47c 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2796,7 +2796,7 @@ sub _resolved_attrs { : ( ( delete $attrs->{columns} ) || - $source->storage->_order_select_columns( + $source->storage->order_select_columns( $source, [ $source->columns ], ) diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index bf7bdf2..eac1dda 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1368,7 +1368,9 @@ sub insert_bulk { == @$cols; if ((not @bind) && (not $empty_bind)) { - croak 'Cannot insert_bulk without support for placeholders'; + $self->throw_exception( + 'Cannot insert_bulk without support for placeholders' + ); } $self->_query_start( $sql, @bind ); @@ -1420,7 +1422,8 @@ sub _execute_array { my $rv = eval { $sth->execute_array({ArrayTupleStatus => $tuple_status}) }; - $guard->commit if $guard; # probably only needed for Sybase +# only needed for Sybase, it requires a commit before the $sth->finish + $guard->commit if $guard; $sth->finish; @@ -2050,15 +2053,23 @@ sub _subq_count_select { return @pcols ? \@pcols : [ 1 ]; } -# -# Returns an ordered list of column names before they are used -# in a SELECT statement. By default simply returns the list -# passed in. -# -# This may be overridden in a specific storage when there are -# requirements such as moving BLOB columns to the end of the -# SELECT list. -sub _order_select_columns { +=head2 order_select_columns + +=over 4 + +=item Arguments: $source, \@columns + +=back + +Returns an ordered list of column names to be used in a SELECT statement. By +default simply returns the list that was passed in. + +This may be overridden in a specific storage when there are requirements such as +moving BLOB columns to the end of the SELECT list. + +=cut + +sub order_select_columns { #my ($self, $source, $columns) = @_; return @{$_[2]}; } diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 8de1865..759f3ac 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -325,7 +325,7 @@ has 'write_handler' => ( _count_select _subq_count_select _subq_update_delete - _order_select_columns + order_select_columns svp_rollback svp_begin svp_release diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index dcba119..e8b9052 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -681,7 +681,7 @@ sub _remove_blob_cols { } } - return keys %blob_cols ? \%blob_cols : undef; + return %blob_cols ? \%blob_cols : undef; } # same for insert_bulk @@ -1088,6 +1088,33 @@ loading your app, if it doesn't match the character set of your database. When inserting IMAGE columns using this method, you'll need to use L as well. +=head1 TODO + +=over + +=item * + +Transitions to AutoCommit=0 (starting a transaction) mode by exhausting +any active cursors, using eager cursors. + +=item * + +Real limits and limited counts using stored procedures deployed on startup. + +=item * + +Adaptive Server Anywhere (ASA) support, with possible SQLA::Limit support. + +=item * + +Blob update with a LIKE query on a blob, without invalidating the WHERE condition. + +=item * + +bulk_insert using prepare_cached (see comments.) + +=back + =head1 AUTHOR See L.