Annotate/Driver/SQLite.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 32 CC 2 SCAR 12.0
CC
2
Cov
0%
table_ddl
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package DBIx::Schema::Annotate::Driver::SQLite;
2 use parent 'DBIx::Schema::Annotate::Driver::Base';
3 use strict;
4 use warnings;
5 use Smart::Args;
6  
7 sub table_ddl {
8 args(
9 my $self,
10 my $table_name => 'Str',
11 );
12  
13 my $schema_row = do {
14 my $sth = $self->{dbh}->prepare(q! SELECT * FROM sqlite_master WHERE type='table' and name = ? !);
15 $sth->execute($table_name);
16 $sth->fetchrow_hashref;
17 };
18 my $index_rows = do {
19 my $sth = $self->{dbh}->prepare(q! SELECT * FROM sqlite_master WHERE type='index' and tbl_name = ? !);
20 $sth->execute($table_name);
21 $sth->fetchall_hashref('sql');
22 };
23
24 return $schema_row->{sql} unless scalar keys %$index_rows;
25 return join("\n", $schema_row->{sql}, sort keys %$index_rows);
26 }
27  
28 1;
29