[Dbix-class] RFC: DBIx-Class-Tree
Nilson Santos Figueiredo Junior
acid06 at gmail.com
Mon Apr 3 19:26:57 CEST 2006
On 4/3/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> If nobody's massively offended by the idea I think I'd like to roll the
> ::Ordered component into 0.06001 along with the SQLT deploy improvements in
> -current.
>
> What do people think of this idea?
I think it's a nice idea.
But while reading its source code something seemed odd to me:
sub insert {
my $self = shift;
my $position_column = $self->position_column;
$self->set_column( $position_column =>
$self->result_source->resultset->search( {$self->_grouping_clause()}
)->count()+1 )
if (!$self->get_column($position_column));
return $self->next::method( @_ );
}
There really isn't a better (i.e. more efficient) way of doing this?
Or is this preferred as it's probably the most "portable" solution
accross the various database backends?
I also couldn't figure out from the docs how that "grouping" stuff
really works, but this is probably just my slow brain. ;-)
-Nilson Santos F. Jr.
More information about the Dbix-class
mailing list