[Dbix-class] Auto-generate random primary keys

Matt S Trout dbix-class at trout.me.uk
Wed Mar 1 16:42:37 CET 2006


On Wed, Mar 01, 2006 at 03:14:29PM +0100, Bernhard Graf wrote:
> Matt S Trout wrote:
> > It's broken.
> >
> > } while ($self->search({$column => $val}));
> >
> > should be
> >
> > } while ($self->result_source->resultset->search({$column => $val}));
> 
> Very sophisticated. ;-)
> 
> Unfortunately this results in an infinite loop.

Not enough coffee, sorry.

> $self->result_source->resultset->search({$column => $val})->next works.

Or ->count, which is probably more efficient.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list