[Bast-commits] r4295 - in DBIx-Class-Fixtures/1.001/trunk: .
lib/DBIx/Class
captainL at dev.catalyst.perl.org
captainL at dev.catalyst.perl.org
Fri Apr 25 17:31:56 BST 2008
Author: captainL
Date: 2008-04-25 17:31:56 +0100 (Fri, 25 Apr 2008)
New Revision: 4295
Modified:
DBIx-Class-Fixtures/1.001/trunk/Changes
DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm
Log:
Optimised populate to take advantage of insert_bulk
Modified: DBIx-Class-Fixtures/1.001/trunk/Changes
===================================================================
--- DBIx-Class-Fixtures/1.001/trunk/Changes 2008-04-25 16:27:50 UTC (rev 4294)
+++ DBIx-Class-Fixtures/1.001/trunk/Changes 2008-04-25 16:31:56 UTC (rev 4295)
@@ -5,6 +5,7 @@
- Added post_ddl and cascade attributes to populate (Drew Taylor)
- Scalar refs in cond clauses handled in sets as well as fetches (Sebastian Willert)
- Directory separators in primary keys do not cause a crash (Sebastian Willert)
+- Optimised populate to take advantage of insert_bulk (Drew Taylor)
1.000001
- Added missing deps
Modified: DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm
===================================================================
--- DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm 2008-04-25 16:27:50 UTC (rev 4294)
+++ DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm 2008-04-25 16:31:56 UTC (rev 4295)
@@ -840,6 +840,7 @@
my $rs = $schema->resultset($source);
my $source_dir = dir($tmp_fixture_dir, lc($rs->result_source->from));
next unless (-e $source_dir);
+ my @rows;
while (my $file = $source_dir->next) {
next unless ($file =~ /\.fix$/);
next if $file->is_dir;
@@ -847,8 +848,9 @@
my $HASH1;
eval($contents);
$HASH1 = $fixup_visitor->visit($HASH1) if $fixup_visitor;
- $rs->create($HASH1);
+ push(@rows, $HASH1);
}
+ $rs->populate(\@rows);
}
if ($params->{post_ddl}) {
More information about the Bast-commits
mailing list