line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1353144
|
use 5.006; |
|
2
|
|
|
|
|
7
|
|
2
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
36
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
91
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Metabase::Index::PostgreSQL; |
6
|
|
|
|
|
|
|
# ABSTRACT: Metabase index backend using SQLite |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.001'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
7
|
use Moose; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
14
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Metabase::Backend::PostgreSQL'; |
13
|
|
|
|
|
|
|
with 'Metabase::Index::SQL'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _build_typemap { |
16
|
|
|
|
|
|
|
return { |
17
|
0
|
|
|
0
|
|
|
'//str' => 'text', |
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
|
0
|
|
|
0
|
|
|
my ($self, $value) = @_; |
30
|
0
|
|
|
|
|
|
$value =~ s{'}{''}g; |
31
|
0
|
|
|
|
|
|
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::PostgreSQL - Metabase index backend using SQLite |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
version 1.001 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SYNOPSIS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
use Metabase::Index::PostgreSQL; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $index = Metabase::Index::PostgreSQL->new( |
55
|
|
|
|
|
|
|
db_name => "cpantesters", |
56
|
|
|
|
|
|
|
db_user => "johndoe", |
57
|
|
|
|
|
|
|
db_pass => "PaSsWoRd", |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This is an implementation of the L<Metabase::Index::SQL> role using PostgreSQL. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 USAGE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
See L<Metabase::Backend::PostgreSQL>, L<Metabase::Index> and |
67
|
|
|
|
|
|
|
L<Metabase::Librarian>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=for Pod::Coverage::TrustPod add query delete count |
70
|
|
|
|
|
|
|
translate_query op_eq op_ne op_gt op_lt op_ge op_le op_between op_like |
71
|
|
|
|
|
|
|
op_not op_or op_and |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHORS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=over 4 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item * |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
David Golden <dagolden@cpan.org> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Leon Brocard <acme@astray.org> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=back |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This software is Copyright (c) 2011 by David Golden. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This is free software, licensed under: |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
The Apache License, Version 2.0, January 2004 |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |