[Dbix-class] DBIx giving err due to camleCase??? not sure..

Henry Van Styn vanstyn at cpan.org
Mon Aug 21 14:25:23 GMT 2017


I think you want { key => ‘primary’ }. In this case the key is the name of the constraint (‘primary’ for the primary key), not the column


> On Aug 21, 2017, at 9:45 AM, Rajeev Prasad <rp.neuli at yahoo.com> wrote:
> 
> no, nodeID is auto increment field as seen in tabel description. it is complaining there is no such key. i dont know why...
> 
> 
> On Monday, August 21, 2017 7:39 AM, tirveni yadav <yadav.tirveni at gmail.com> wrote:
> 
> 
> On Mon, Aug 21, 2017 at 6:50 AM, Rajeev Prasad <rp.neuli at yahoo.com <mailto:rp.neuli at yahoo.com>> wrote:
> >
> > why am i getting this err in DBIx::Class ?
> >
> > $./update_db.pl
> > DBIx::Class::ResultSource::unique_constraint_columns(): Unknown unique
> > constraint nodeid on 'node' at ./update_from_ieds.pl line 80
> >
> >
> > relevant code:
> > ...
> > sub addNode
> > {
> >    my $node = shift; my $lcNode = lc($node);
> >    my $id = $schema
> >        ->resultset('Node')
> >        ->find_or_create
> >        (
> >            { nodeName => $lcNode },
> >            { key => 'nodeid' }
> >        );
> >    return $id;
> > }
> 
> 
> Are you trying to do this:
> 
> 
> my $id = $schema
>         ->resultset('Node')->find_or_create
>       (
>             {
>             nodeName  => $lcNode ,
> 
>                 nodeID    => $nodeid,
>         }
>         );
> 
> 
> -- 
> Regards,
> 
> Tirveni Yadav
> 
> www.bael.io
> 
> What is this Universe ? From what it arises ? Into what does it go?
> In freedom it arises, In freedom it rests and into freedom it melts away.
> Upanishads.
> 
> 
> 
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20170821/36318b2b/attachment.htm>


More information about the DBIx-Class mailing list