File Coverage

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