[Dbix-class] For a reliable update_or_create we need to make create( { primary_key => undef, ... } ) work in Pg

Zbigniew Lukasiak zzbbyy at gmail.com
Wed Jan 23 06:42:47 GMT 2008


On Jan 23, 2008 7:07 AM, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Tue, Jan 22, 2008 at 12:43:12PM +0100, Zbigniew Lukasiak wrote:
> > Is it ever possible that it works 100%?  I mean - the Relationship POD
> > says that "The condition needs to be an SQL::Abstract-style
> > representation of the join between the tables" and from follows there,
> > it looks that it really can be nearly any SQL::Abstract structure.  Is
> > it ever feasible that we parse the SQL::Abstract query and determine
> > if it chooses a unique row?  And if not then where you suppose to
> > stop?
>
> Of course you can't always determine. But if you don't know, then you default
> to "no it doesn't produce a unique row" and provide some way for the user to
> say "actually I know it does and I accept you can't help me if I'm wrong" :)

This more or less amounts to "don't rely on find when you call it
without a unique key" isn't it?


-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/



More information about the DBIx-Class mailing list