line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::CSSQuery; |
2
|
4
|
|
|
4
|
|
201244
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
154
|
|
3
|
4
|
|
|
4
|
|
96
|
use 5.008; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
149
|
|
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
2794
|
use DBIx::CSSQuery::Collection; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Sub::Exporter -setup => { |
10
|
|
|
|
|
|
|
exports => [qw(db)] |
11
|
|
|
|
|
|
|
}; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
{ |
14
|
|
|
|
|
|
|
my $db; |
15
|
|
|
|
|
|
|
sub db { |
16
|
|
|
|
|
|
|
my @args = @_; |
17
|
|
|
|
|
|
|
$db ||= DBIx::CSSQuery::Collection->new(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
return $db->{db} if !@args; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
if ($args[0]) { |
22
|
|
|
|
|
|
|
$db->{selector} = $args[0]; |
23
|
|
|
|
|
|
|
$db->{sql_params} = { |
24
|
|
|
|
|
|
|
order => "ORDER BY id ASC", |
25
|
|
|
|
|
|
|
limit => undef |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
return $db; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |