Revision history for DBIx::Class
+ * New Features / Changes
+ - The emulate_limit() arbitrary limit dialect emulation mechanism is
+ now deprecated, and will be removed when DBIx::Class migrates to
+ Data::Query
* Fixes
- When performing resultset update/delete only strip condition
qualifiers - leave the source name alone (RT#80015, RT#78844)
($sql, @bind) = $self->next::method ($table, $fields, $where);
- my $limiter =
- $self->can ('emulate_limit') # also backcompat hook from SQLA::Limit
- ||
- do {
- my $dialect = $self->limit_dialect
- or $self->throw_exception( "Unable to generate SQL-limit - no limit dialect specified on $self, and no emulate_limit method found" );
- $self->can ("_$dialect")
- or $self->throw_exception(__PACKAGE__ . " does not implement the requested dialect '$dialect'");
- }
- ;
+ my $limiter;
+
+ if( $limiter = $self->can ('emulate_limit') ) {
+ carp_unique(
+ 'Support for the legacy emulate_limit() mechanism inherited from '
+ . 'SQL::Abstract::Limit has been deprecated, and will be removed when '
+ . 'DBIC transitions to Data::Query. If your code uses this type of '
+ . 'limit specification please file an RT and provide the source of '
+ . 'your emulate_limit() implementation, so an acceptable upgrade-path '
+ . 'can be devised'
+ );
+ }
+ else {
+ my $dialect = $self->limit_dialect
+ or $self->throw_exception( "Unable to generate SQL-limit - no limit dialect specified on $self" );
+
+ $limiter = $self->can ("_$dialect")
+ or $self->throw_exception(__PACKAGE__ . " does not implement the requested dialect '$dialect'");
+ }
$sql = $self->$limiter (
$sql,
use warnings;
use Test::More;
+use Test::Warn;
use lib qw(t/lib);
use DBICTest;
$s->storage->sql_maker_class ('DBICTest::SQLMaker::CustomDialect');
my $rs = $s->resultset ('CD');
-is_same_sql_bind (
+
+warnings_exist { is_same_sql_bind (
$rs->search ({}, { rows => 1, offset => 3,columns => [
{ id => 'foo.id' },
{ 'bar.id' => 'bar.id' },
)',
[],
'Rownum subsel aliasing works correctly'
-);
+ )}
+ qr/\Qthe legacy emulate_limit() mechanism inherited from SQL::Abstract::Limit has been deprecated/,
+ 'deprecation warning'
+;
done_testing;