X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=89cf5a35abf92f302d2585c7d01f96cac724e00f;hb=26283ee38f220f6c6bae720ea5a189c9c0f47f6f;hp=4990e78c4a99cbb16c21ffecf1ec7f6d9869aae7;hpb=37b17a93efef4652db90e299b247e55ab1145b0b;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 4990e78..89cf5a3 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -14,6 +14,11 @@ use DBIx::Class::Storage::Statistics; use Scalar::Util(); use List::Util(); +# what version of sqlt do we require if deploy() without a ddl_dir is invoked +# when changing also adjust the corresponding author_require in Makefile.PL +my $minimum_sqlt_version = '0.11002'; + + __PACKAGE__->mk_group_accessors('simple' => qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid _conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints/ @@ -1002,6 +1007,8 @@ sub _connect { $weak_self->throw_exception("DBI Exception: $_[0]"); } else { + # the handler may be invoked by something totally out of + # the scope of DBIC croak ("DBI Exception: $_[0]"); } }; @@ -1986,18 +1993,6 @@ 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 { - #my ($self, $source, $columns) = @_; - return @{$_[2]}; -} sub source_bind_attributes { my ($self, $source) = @_; @@ -2616,6 +2611,33 @@ sub lag_behind_master { return; } +# SQLT version handling +{ + my $_sqlt_version_ok; # private + my $_sqlt_version_error; # private + + sub _sqlt_version_ok { + if (!defined $_sqlt_version_ok) { + eval "use SQL::Translator $minimum_sqlt_version"; + if ($@) { + $_sqlt_version_ok = 0; + $_sqlt_version_error = $@; + } + else { + $_sqlt_version_ok = 1; + } + } + return $_sqlt_version_ok; + } + + sub _sqlt_version_error { + shift->_sqlt_version_ok unless defined $_sqlt_version_ok; + return $_sqlt_version_error; + } + + sub _sqlt_minimum_version { $minimum_sqlt_version }; +} + sub DESTROY { my $self = shift;