objects that went out of sync with the storage (RT#96499)
- CDBICompat::columns() now supports adding columns through supplied
Class::DBI::Column instances (GH#52)
+ - Deprecate { col1 => col2 } expressions in manual from structures
+ (at some point of time manual from will be deprecated itself)
* Fixes
- Fix Resultset delete/update affecting *THE ENTIRE TABLE* in cases
# Backcompat for the old days when a plain hashref
# { 't1.col1' => 't2.col2' } meant ON t1.col1 = t2.col2
- # Once things settle we should start warning here so that
- # folks unroll their hacks
if (
ref $cond eq 'HASH'
and
and
! ref ( (values %$cond)[0] )
) {
+ carp_unique(
+ "ResultSet {from} structures with conditions not conforming to the "
+ . "SQL::Abstract syntax are deprecated: you either need to stop abusing "
+ . "{from} altogether, or express the condition properly using the "
+ . "{ -ident => ... } operator"
+ );
$cond = { keys %$cond => { -ident => values %$cond } }
}
elsif ( ref $cond eq 'ARRAY' ) {
use lib qw(t/lib);
use DBICTest ':DiffSQL';
use DBIx::Class::SQLMaker::LimitDialects;
+use DBIx::Class::_Util 'sigwarn_silencer';
my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype;
for my $i (0 .. $#tests) {
my $t = $tests[$i];
for my $p (1, 2) { # repeat everything twice, make sure we do not clobber search arguments
+ local $SIG{__WARN__} = sigwarn_silencer( qr/\Q{from} structures with conditions not conforming to the SQL::Abstract syntax are deprecated/ );
+
is_same_sql_bind (
$t->{rs}->search ($t->{search}, $t->{attrs})->as_query,
$t->{sqlbind},
'-join_type' => ''
},
{
- 'artist.artistid' => 'me.artist'
+ 'artist.artistid' => { -ident => 'me.artist' },
}
],
[
'-join_type' => 'left'
},
{
- 'tracks.cd' => 'me.cdid'
+ 'tracks.cd' => { -ident => 'me.cdid' },
}
],
],
'-join_type' => ''
},
{
- 'artist.artistid' => 'me.artist'
+ 'artist.artistid' => { -ident => 'me.artist' }
}
]
],
use Test::More;
use lib qw(t/lib);
use DBICTest ':DiffSQL';
+use DBIx::Class::_Util 'sigwarn_silencer';
use DBIx::Class::SQLMaker;
my $sa = DBIx::Class::SQLMaker->new;
+$SIG{__WARN__} = sigwarn_silencer( qr/\Q{from} structures with conditions not conforming to the SQL::Abstract syntax are deprecated/ );
+
my @j = (
{ child => 'person' },
[ { father => 'person' }, { 'father.person_id' => 'child.father_id' }, ],
{ me => "cd" },
[
{ "-join_type" => "LEFT", artist => "artist" },
- { "artist.artistid" => "me.artist" },
+ { "artist.artistid" => { -ident => "me.artist" } },
],
],
[ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
{ me => "cd" },
[
{ "-join_type" => "LEFT", track => "track" },
- { "track.cd" => "me.cdid" },
+ { "track.cd" => { -ident => "me.cdid" } },
],
[
{ artist => "artist" },
- { "artist.artistid" => "me.artist" },
+ { "artist.artistid" => { -ident => "me.artist" } },
],
],
[ 'track.title', 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],