File Coverage

blib/lib/Geoffrey/Converter/SQLite/Tables.pm
Criterion Covered Total %
statement 27 27 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 6 6 100.0
total 45 45 100.0


line stmt bran cond sub pod time code
1             package Geoffrey::Converter::SQLite::Tables;
2              
3 5     5   30 use utf8;
  5         10  
  5         29  
4 5     5   228 use 5.016;
  5         27  
5 5     5   21 use strict;
  5         7  
  5         111  
6 5     5   18 use Readonly;
  5         46  
  5         266  
7 5     5   34 use warnings;
  5         8  
  5         373  
8              
9             $Geoffrey::Converter::SQLite::Tables::VERSION = '0.000206';
10              
11 5     5   24 use parent 'Geoffrey::Role::ConverterType';
  5         8  
  5         33  
12              
13 10     10 1 86 sub add { return q~CREATE TABLE {0} ( {1} )~; }
14              
15 1     1 1 6 sub drop { return q~DROP TABLE {0}~; }
16              
17 6     6 1 23 sub alter { return q~ALTER TABLE {0}~; }
18              
19 6     6 1 17 sub add_column { return $_[0]->alter . q~ ADD COLUMN {1}~; }
20              
21             sub list {
22 3     3 1 10 my ( $self, $schema ) = @_;
23 3         23 require Geoffrey::Utils;
24             return
25 3         16 q~SELECT name FROM ~
26             . Geoffrey::Utils::add_schema($schema)
27             . q~sqlite_master WHERE type='table'~;
28             }
29              
30             sub s_list_columns {
31 3     3 1 8 my ( $self, $schema ) = @_;
32 3         16 require Geoffrey::Utils;
33             return
34 3         15 q~SELECT sql FROM ~
35             . Geoffrey::Utils::add_schema($schema)
36             . q~sqlite_master WHERE type='table' AND name=?~;
37             }
38              
39             1; # End of Geoffrey::Converter::SQLite::Tables
40              
41             __END__