DBIx-Class-ResultSet-RecursiveUpdate
view release on metacpan or search on metacpan
t_dbic/lib/DBICTest.pm view on Meta::CPAN
312313314315316317318319320321322323324325326327328329330331332sub
deploy_schema {
my
$self
=
shift
;
my
$schema
=
shift
;
my
$args
=
shift
|| {};
if
(
$ENV
{
"DBICTEST_SQLT_DEPLOY"
}) {
$schema
->deploy(
$args
);
}
else
{
my
$filename
= Path::Class::File->new(__FILE__)->dir
->file(
'sqlite.sql'
)->stringify;
my
$sql
=
do
{
local
(
@ARGV
, $/) =
$filename
; <> };
for
my
$chunk
(
split
(/;\s*\n+/,
$sql
) ) {
if
(
$chunk
=~ / ^ (?! --\s* ) \S /xm ) {
# there is some real sql in the chunk - a non-space at the start of the string which is not a comment
$schema
->storage->dbh_do(
sub
{
$_
[1]->
do
(
$chunk
) }) or
"Error on SQL: $chunk\n"
;
}
}
}
return
;
}
=head2 populate_schema
( run in 1.262 second using v1.01-cache-2.11-cpan-49f99fa48dc )