line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::AquariumHive::DB; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
1113
|
$App::AquariumHive::DB::AUTHORITY = 'cpan:GETTY'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
$App::AquariumHive::DB::VERSION = '0.002'; |
6
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
722
|
use namespace::clean; |
|
1
|
|
|
|
|
4606
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'DBIx::Class::Schema'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$ENV{DBIC_NULLABLE_KEY_NOWARN} = 1; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'App::AquariumHive::LogRole'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
__PACKAGE__->load_namespaces( |
16
|
|
|
|
|
|
|
default_resultset_class => 'ResultSet', |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has _app => ( |
20
|
|
|
|
|
|
|
is => 'rw', |
21
|
|
|
|
|
|
|
); |
22
|
0
|
|
|
0
|
0
|
|
sub app { shift->_app } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub connect { |
25
|
0
|
|
|
0
|
1
|
|
my ( $self, $app ) = @_; |
26
|
0
|
0
|
|
|
|
|
$app = $self->app if ref $self; |
27
|
0
|
|
|
|
|
|
my $schema = $self->next::method("dbi:SQLite::memory:","","",{ |
28
|
|
|
|
|
|
|
sqlite_unicode => 1, |
29
|
|
|
|
|
|
|
quote_char => '"', |
30
|
|
|
|
|
|
|
name_sep => '.', |
31
|
|
|
|
|
|
|
}); |
32
|
0
|
|
|
|
|
|
$schema->_app($app); |
33
|
0
|
|
|
|
|
|
return $schema; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
0
|
|
sub format_datetime { shift->storage->datetime_parser->format_datetime(shift) } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
App::AquariumHive::DB |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 VERSION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
version 0.002 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Torsten Raudssus <torsten@raudss.us> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Torsten Raudssus. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
61
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |