File Coverage

blib/lib/Biblio/Zotero/DB/Schema.pm
Criterion Covered Total %
statement 19 21 90.4
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 26 28 92.8


line stmt bran cond sub pod time code
1 12     12   33616 use utf8;
  12         104  
  12         61  
2             package Biblio::Zotero::DB::Schema;
3             $Biblio::Zotero::DB::Schema::VERSION = '0.004';
4             # Created by DBIx::Class::Schema::Loader
5             # DO NOT MODIFY THE FIRST PART OF THIS FILE
6              
7 12     12   780 use strict;
  12         23  
  12         376  
8 12     12   54 use warnings;
  12         18  
  12         345  
9              
10 12     12   48 use base 'DBIx::Class::Schema';
  12         16  
  12         7731  
11              
12             __PACKAGE__->load_namespaces;
13              
14              
15             # Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38
16             # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UlX+tV+7vyST2GUwO/11dw
17              
18             # NOTE: extended DBIC schema below
19              
20 12     12   580863 use Moo;
  12         3295  
  12         92  
21 12     12   3831 use Path::Class;
  12         55105  
  12         873  
22 12     12   4738 use Path::Class::URI;
  0            
  0            
23              
24             extends 'DBIx::Class::Schema';
25              
26              
27             has zotero_storage_directory => ( is => 'rw' );
28              
29             around connection => sub {
30             my ( $inner, $self, $dsn, $username, $pass, $attr ) = ( shift, @_ );
31              
32             $self->zotero_storage_directory(dir(
33             delete $attr->{zotero_storage_directory}
34             )->absolute) if(exists $attr->{zotero_storage_directory});
35              
36             $attr->{ReadOnly} = 1; # force to be readonly
37             $attr->{sqlite_unicode} = 1; # strings are UTF-8
38             # there are no SQL_BLOB types in the schema, so this should be fine
39              
40             $inner->(@_);
41             };
42              
43             1;
44              
45             __END__