line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TableData::DBI; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
124512
|
use 5.010001; |
|
1
|
|
|
|
|
14
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
448
|
use Role::Tiny::With; |
|
1
|
|
|
|
|
264
|
|
|
1
|
|
|
|
|
209
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
10
|
|
|
|
|
|
|
our $DATE = '2023-06-14'; # DATE |
11
|
|
|
|
|
|
|
our $DIST = 'TableDataRoles-Standard'; # DIST |
12
|
|
|
|
|
|
|
our $VERSION = '0.016'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'TableDataRole::Source::DBI'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our %SPEC; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$SPEC{new} = { |
19
|
|
|
|
|
|
|
v => 1.1, |
20
|
|
|
|
|
|
|
is_meth => 1, |
21
|
|
|
|
|
|
|
is_func => 0, |
22
|
|
|
|
|
|
|
args => { |
23
|
|
|
|
|
|
|
dsn => { |
24
|
|
|
|
|
|
|
schema => 'str*', |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
dbh => { |
27
|
|
|
|
|
|
|
schema => 'obj*', |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
sth => { |
30
|
|
|
|
|
|
|
schema => 'obj*', |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# only when using dsn |
34
|
|
|
|
|
|
|
user => { |
35
|
|
|
|
|
|
|
schema => ['any*', of=>['str*', 'code*']], |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
password => { |
38
|
|
|
|
|
|
|
schema => ['any*', of=>['str*', 'code*']], |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# only when using dsn or dbh |
42
|
|
|
|
|
|
|
query => { |
43
|
|
|
|
|
|
|
schema => 'str*', |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
table => { |
46
|
|
|
|
|
|
|
schema => 'str*', |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# only when using sth |
50
|
|
|
|
|
|
|
sth_bind_params => { |
51
|
|
|
|
|
|
|
schema => 'array*', |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
row_count_sth => { |
55
|
|
|
|
|
|
|
schema => 'obj*', |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
row_count_query => { |
58
|
|
|
|
|
|
|
schema => 'obj*', |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# only when using row_count_sth |
62
|
|
|
|
|
|
|
row_count_sth_bind_params => { |
63
|
|
|
|
|
|
|
schema => 'array*', |
64
|
|
|
|
|
|
|
}, |
65
|
|
|
|
|
|
|
}, |
66
|
|
|
|
|
|
|
args_rels => { |
67
|
|
|
|
|
|
|
req_one => [qw/dsn dbh sth/], |
68
|
|
|
|
|
|
|
choose_one => [qw/query table/], |
69
|
|
|
|
|
|
|
'dep_any&' => [ |
70
|
|
|
|
|
|
|
[user => [qw/dsn/]], |
71
|
|
|
|
|
|
|
[password => [qw/dsn/]], |
72
|
|
|
|
|
|
|
[query => [qw/dsn dbh/]], |
73
|
|
|
|
|
|
|
[row_count_query => [qw/dsn dbh/]], |
74
|
|
|
|
|
|
|
[table => [qw/dsn dbh/]], |
75
|
|
|
|
|
|
|
[sth_bind_params => [qw/sth/]], |
76
|
|
|
|
|
|
|
[row_count_sth_bind_params => [qw/row_count_sth/]], |
77
|
|
|
|
|
|
|
], |
78
|
|
|
|
|
|
|
}, |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
# ABSTRACT: Get table data from DBI |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |