File Coverage

lib/DBIx/Schema/Changelog/Driver/SQLite.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 30 30 100.0


line stmt bran cond sub pod time code
1             package DBIx::Schema::Changelog::Driver::SQLite;
2              
3             =head1 NAME
4              
5             DBIx::Schema::Changelog::Driver::SQLite - The great new DBIx::Schema::Changelog::Driver::SQLite!
6              
7             =head1 VERSION
8              
9             Version 0.7.2
10              
11             =cut
12              
13             our $VERSION = '0.7.2';
14              
15 7     7   167221 use strict;
  7         15  
  7         284  
16 7     7   28 use warnings FATAL => 'all';
  7         9  
  7         899  
17 7     7   2495 use Moose;
  7         1759922  
  7         54  
18 7     7   43082 use MooseX::HasDefaults::RO;
  7         50313  
  7         52  
19 7     7   48213 use MooseX::Types::PerlVersion qw( PerlVersion );
  7         303122  
  7         37  
20 7     7   7834 use Method::Signatures::Simple;
  7         34454  
  7         51  
21              
22             with 'DBIx::Schema::Changelog::Driver';
23              
24             has actions => (
25             isa => 'HashRef[Str]',
26             default => sub {
27             return {
28             create_table => 'CREATE TABLE {0} ( {1} )',
29             drop_table => 'DROP TABLE {0}',
30             alter_table => 'ALTER TABLE {0}',
31             add_column => 'ADD COLUMN {0}',
32             create_view => 'CREATE VIEW {0} AS {1}',
33             drop_view => 'DROP VIEW {0}',
34             foreign_key => q~FOREIGN KEY ({0}) REFERENCES {1}({2})~,
35             };
36             }
37             );
38              
39             has constraints => (
40             isa => 'HashRef[Str]',
41             default => sub {
42             return {
43             not_null => 'NOT NULL',
44             unique => 'UNIQUE',
45             primary_key => 'PRIMARY KEY',
46             foreign_key => 'FOREIGN KEY',
47             check => 'CHECK',
48             default => 'DEFAULT',
49             };
50             }
51             );
52              
53             has defaults => (
54             isa => 'HashRef[Str]',
55             default => sub {
56             return {
57             current => 'CURRENT_TIMESTAMP',
58             inc => 'AUTOINCREMENT',
59             };
60             }
61             );
62              
63             has types => (
64             isa => 'HashRef[Str]',
65             default => sub {
66             return {
67             blob => 'BLOB',
68             integer => 'INTEGER',
69             numeric => 'NUMERIC',
70             real => 'REAL',
71             text => 'TEXT',
72             bool => 'BOOL',
73             double => 'DOUBLE',
74             float => 'FLOAT',
75             char => 'CHAR',
76             varchar => 'VARCHAR',
77             timestamp => 'DATETIME',
78             };
79             }
80             );
81              
82             has select_changelog_table => (
83             isa => 'Str',
84             lazy => 1,
85             default => "SELECT * FROM sqlite_master WHERE type='table';",
86             );
87              
88 8     8   236 sub _min_version { '3.7' }
89              
90 7     7   3401 no Moose;
  7         10  
  7         45  
91             __PACKAGE__->meta->make_immutable;
92              
93             1; # End of DBIx::Schema::Changelog::Driver::SQLite
94              
95             __END__
96              
97             =head1 BUGS
98              
99             Please report any bugs or feature requests to C<bug-dbix-schema-changelog-driver-sqlite at rt.cpan.org>, or through
100             the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Schema-Changelog-Driver-SQLite>. I will be notified, and then you'll
101             automatically be notified of progress on your bug as I make changes.
102              
103              
104             =head1 SUPPORT
105              
106             You can find documentation for this module with the perldoc command.
107              
108             perldoc DBIx::Schema::Changelog::Driver::SQLite
109              
110              
111             You can also look for information at:
112              
113             =over 4
114              
115             =item * RT: CPAN's request tracker (report bugs here)
116              
117             L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Schema-Changelog-Driver-SQLite>
118              
119             =item * AnnoCPAN: Annotated CPAN documentation
120              
121             L<http://annocpan.org/dist/DBIx-Schema-Changelog-Driver-SQLite>
122              
123             =item * CPAN Ratings
124              
125             L<http://cpanratings.perl.org/d/DBIx-Schema-Changelog-Driver-SQLite>
126              
127             =item * Search CPAN
128              
129             L<http://search.cpan.org/dist/DBIx-Schema-Changelog-Driver-SQLite/>
130              
131             =back
132              
133             =head1 AUTHOR
134              
135             Mario Zieschang, C<< <mario.zieschang at combase.de> >>
136              
137              
138             =head1 LICENSE AND COPYRIGHT
139              
140             Copyright 2015 Mario Zieschang.
141              
142             This program is free software; you can redistribute it and/or modify it
143             under the terms of the the Artistic License (2.0). You may obtain a
144             copy of the full license at:
145              
146             L<http://www.perlfoundation.org/artistic_license_2_0>
147              
148             Any use, modification, and distribution of the Standard or Modified
149             Versions is governed by this Artistic License. By using, modifying or
150             distributing the Package, you accept this license. Do not use, modify,
151             or distribute the Package, if you do not accept this license.
152              
153             If your Modified Version has been derived from a Modified Version made
154             by someone other than you, you are nevertheless required to ensure that
155             your Modified Version complies with the requirements of this license.
156              
157             This license does not grant you the right to use any trademark, service
158             mark, trade name, or logo of the Copyright Holder.
159              
160             This license includes the non-exclusive, worldwide, free-of-charge
161             patent license to make, have made, use, offer to sell, sell, import and
162             otherwise transfer the Package with respect to any patent claims
163             licensable by the Copyright Holder that are necessarily infringed by the
164             Package. If you institute patent litigation (including a cross-claim or
165             counterclaim) against any party alleging that the Package constitutes
166             direct or contributory patent infringement, then this Artistic License
167             to you shall terminate on the date that such litigation is filed.
168              
169             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
170             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
171             THE IMPLIED WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A PARTICULAR
172             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
173             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
174             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
175             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
176             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
177              
178             =cut