- The emulate_limit() arbitrary limit dialect emulation mechanism is
now deprecated, and will be removed when DBIx::Class migrates to
Data::Query
+ - Support for the source_bind_attributes() storage method has been
+ removed after a lengthy deprecation cycle
* Fixes
- When performing resultset update/delete only strip condition
qualifiers - leave the source name alone (RT#80015, RT#78844)
(RT#78436)
* Misc
- Improve the populate docs in ::Schema and ::ResultSet
+ - ::Storage::DBI::source_bind_attributes() removed as announced
+ on Jan 2011 in 0e773352a
0.08204 2012-11-08
* New Features / Changes
Class::C3->reinitialize() if DBIx::Class::_ENV_::OLD_MRO;
+ if ($self->can('source_bind_attributes')) {
+ $self->throw_exception(
+ "Your storage subclass @{[ ref $self ]} provides (or inherits) the method "
+ . 'source_bind_attributes() for which support has been removed as of Jan 2013. '
+ . 'If you are not sure how to proceed please contact the development team via '
+ . 'http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class.pm#GETTING_HELP/SUPPORT'
+ );
+ }
+
$self->_init; # run driver-specific initializations
$self->_run_connection_actions
if $self->debug;
}
-my $sba_compat;
sub _dbi_attrs_for_bind {
my ($self, $ident, $bind) = @_;
- if (! defined $sba_compat) {
- $self->_determine_driver;
- $sba_compat = $self->can('source_bind_attributes') == \&source_bind_attributes
- ? 0
- : 1
- ;
- }
-
- my $sba_attrs;
- if ($sba_compat) {
- my $class = ref $self;
- carp_unique (
- "The source_bind_attributes() override in $class relies on a deprecated codepath. "
- .'You are strongly advised to switch your code to override bind_attribute_by_datatype() '
- .'instead. This legacy compat shim will also disappear some time before DBIC 0.09'
- );
-
- my $sba_attrs = $self->source_bind_attributes
- }
-
my @attrs;
for (map { $_->[0] } @$bind) {
}
$cache->{$_->{sqlt_datatype}};
}
- elsif ($sba_attrs and $_->{dbic_colname}) {
- $sba_attrs->{$_->{dbic_colname}} || undef;
- }
else {
undef; # always push something at this position
}
return { count => '*' };
}
-sub source_bind_attributes {
- shift->throw_exception(
- 'source_bind_attributes() was never meant to be a callable public method - '
- .'please contact the DBIC dev-team and describe your use case so that a reasonable '
- .'solution can be provided'
- ."\nhttp://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class.pm#GETTING_HELP/SUPPORT"
- );
-}
-
=head2 select
=over 4
_arm_global_destructor
_verify_pid
- source_bind_attributes
-
get_use_dbms_capability
set_use_dbms_capability
get_dbms_capability
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warn;
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
+
+{
+ package DBICTest::Legacy::Storage;
+ use base 'DBIx::Class::Storage::DBI::SQLite';
+
+ use Data::Dumper::Concise;
+
+ sub source_bind_attributes { return {} }
+}
+
+
+my $schema = DBICTest::Schema->clone;
+$schema->storage_type('DBICTest::Legacy::Storage');
+$schema->connection('dbi:SQLite::memory:');
+
+throws_ok
+ { $schema->storage->ensure_connected }
+ qr/\Qstorage subclass DBICTest::Legacy::Storage provides (or inherits) the method source_bind_attributes()/,
+ 'deprecated use of source_bind_attributes throws',
+;
+
+done_testing;
+++ /dev/null
-use strict;
-use warnings;
-
-use Test::More;
-use Test::Warn;
-use Test::Exception;
-use lib qw(t/lib);
-use DBICTest;
-
-{
- package DBICTest::Legacy::Storage;
- use base 'DBIx::Class::Storage::DBI::SQLite';
-
- use Data::Dumper::Concise;
-
- sub source_bind_attributes { return {} }
-}
-
-
-my $schema = DBICTest::Schema->clone;
-$schema->storage_type('DBICTest::Legacy::Storage');
-$schema->connection('dbi:SQLite::memory:');
-
-$schema->storage->dbh_do( sub { $_[1]->do(<<'EOS') } );
-CREATE TABLE artist (
- artistid INTEGER PRIMARY KEY NOT NULL,
- name varchar(100),
- rank integer NOT NULL DEFAULT 13,
- charfield char(10)
-)
-EOS
-
-my $legacy = sub { $schema->resultset('Artist')->search({ name => 'foo'})->next };
-if (DBIx::Class->VERSION >= 0.09) {
- &throws_ok(
- $legacy,
- qr/XXXXXXXXX not sure what error to put here yet XXXXXXXXXXXXXXX/,
- 'deprecated use of source_bind_attributes throws',
- );
-}
-else {
- &warnings_exist (
- $legacy,
- qr/\QThe source_bind_attributes() override in DBICTest::Legacy::Storage relies on a deprecated codepath/,
- 'Warning issued during invocation of legacy storage codepath',
- );
-}
-
-done_testing;