DBIx-Class-RandomStringColumns
view release on metacpan or search on metacpan
t/03_prefetch_problem.t view on Meta::CPAN
package TestDB::Schema::Bar;
use strict;
use warnings;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/RandomStringColumns Core/);
__PACKAGE__->table('bar');
__PACKAGE__->add_columns(qw(foo_id session_id u_rand_id));
__PACKAGE__->set_primary_key('session_id');
__PACKAGE__->belongs_to('foo_id', 'TestDB::Schema::Foo', 'foo_id', {cascade_delete => 0});
__PACKAGE__->resultset_attributes({where => {'foo_id.delete_fg' => 0}, prefetch => 'foo_id', order_by => 'me.session_id DESC'});
__PACKAGE__->random_string_columns('u_rand_id');
__PACKAGE__->random_string_columns('session_id');
1;
}
my (undef, $DB) = tempfile();
my $schema = TestDB::Schema->connection("dbi:SQLite:dbname=$DB", '', '', { AutoCommit => 1 });
END { unlink $DB if -e $DB }
( run in 1.032 second using v1.01-cache-2.11-cpan-49f99fa48dc )