sha*_*ess 5 perl catalyst dbix-class
我想知道dbix中的多个唯一约束是否可能update_or_create
来自Cpan:
my $cd = $schema->resultset('CD')->update_or_create(
{
artist => 'Massive Attack',
title => 'Mezzanine',
year => 1998,
},
{ key => 'cd_artist_title' }
);
Run Code Online (Sandbox Code Playgroud)
我想做什么
my $cd = $schema->resultset('CD')->update_or_create(
{
artist => 'Massive Attack',
title => 'Mezzanine',
year => 1998,
},
{ key => {'cd_artist_title','year' }
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1526 次 |
| 最近记录: |