Good morning,

I need a constraint which is identical to
Constraint::DBIC::Unique in concept, but requires slightly
different implementation. I can either create my own or supply
patches for Constraint::DBIC::Unique. So I'm asking for comments
from others.

Currently C::DBIC::Unique will only check for unique values by
doing a 'find' (& checking primary keys) before returning true/false.

Rather than doing a find on a column in the resultset, I need to
call a method on the resultset and return that value. The
resultset method is simply checking for uniqueness across two
tables, so maybe there is a better way of achieving that anyway.

Thoughts? Comments? Should I write a custom constraint or does
this sound like a good addition to C::DBIC::Unique? My idea was
to create an alternate config option; rather than supplying
'column' in the Constraint config, supply 'method' instead. And
C::DBIC::Unique would simply return the value from 'method'
rather than doing a column find.

Another thought I had was a custom resultset class (view?) which
combines both tables and just using C::DBIC::Unique as it is
now. But that seems like more effort and not as clean.


? Charlie Garrison ? <garrison@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
? http://www.ietf.org/rfc/rfc1855.txt

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouphtml-formfu @
categoriesperl, catalyst
postedMay 22, '10 at 12:34a
activeMay 22, '10 at 12:34a

1 user in discussion

Charlie Garrison: 1 post



site design / logo © 2022 Grokbase