line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
1712870
|
use 5.006; |
|
4
|
|
|
|
|
15
|
|
2
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
106
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
259
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Metabase::Index::SQLite; |
6
|
|
|
|
|
|
|
# ABSTRACT: Metabase index backend using SQLite |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.001'; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
23
|
use Moose; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
37
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Metabase::Backend::SQLite'; |
13
|
|
|
|
|
|
|
with 'Metabase::Index::SQL'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _build_typemap { |
16
|
|
|
|
|
|
|
return { |
17
|
70
|
|
|
70
|
|
2242
|
'//str' => 'varchar(255)', |
18
|
|
|
|
|
|
|
'//num' => 'integer', |
19
|
|
|
|
|
|
|
'//bool' => 'boolean', |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _quote_field { |
24
|
|
|
|
|
|
|
my ($self, $field) = @_; |
25
|
|
|
|
|
|
|
return join(".", map { qq{"$_"} } split qr/\./, $field); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _quote_val { |
29
|
466
|
|
|
466
|
|
690
|
my ($self, $value) = @_; |
30
|
466
|
|
|
|
|
895
|
$value =~ s{'}{''}g; |
31
|
466
|
|
|
|
|
3082
|
return qq{'$value'}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=encoding UTF-8 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Metabase::Index::SQLite - Metabase index backend using SQLite |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
version 1.001 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SYNOPSIS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
use Metabase::Index::SQLite; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $index = Metabase::Index:SQLite->new( |
55
|
|
|
|
|
|
|
filename => $sqlite_file, |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This is an implementation of the L<Metabase::Index::SQL> role using SQLite. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 USAGE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
See L<Metabase::Index>, L<Metabase::Query> and L<Metabase::Librarian>. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=for Pod::Coverage::TrustPod add query delete count |
67
|
|
|
|
|
|
|
translate_query op_eq op_ne op_gt op_lt op_ge op_le op_between op_like |
68
|
|
|
|
|
|
|
op_not op_or op_and |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHORS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=over 4 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item * |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
David Golden <dagolden@cpan.org> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Leon Brocard <acme@astray.org> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This software is Copyright (c) 2011 by David Golden. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This is free software, licensed under: |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
The Apache License, Version 2.0, January 2004 |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |