DBIx-RunSQL

 view release on metacpan or  search on metacpan

t/02-trigger.t  view on Meta::CPAN

    require DBD::SQLite;
    1
};

if (not $can_run) {
    plan skip_all => "SQLite not installed";
}

plan tests => 2;

my $sql = do { local (@ARGV,$/) = 't/trigger.sql'; <> };
my @statements;
while( defined( my $frag = DBIx::RunSQL->split_sql( $sql ))) {
    push @statements, $frag;
}
is \@statements, [
  '-- This commented-out statement will not get passed through',
  "-- SECRET PRAGMA #foo will get passed through with the next statement\r\n"
  . "create table test (\r\n"
  . "    id integer unique not null,\r\n"
  . "    descr text default '',\r\n"



( run in 0.800 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )