dbMan/DBI.pm

filter: Statementstmt 9.6% 23 / 238 Branchbran 0.0% 0 / 134 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 16.2% 7 / 43 Podpod 0.0% 0 / 34 totaltotal 6.3% 30 / 472 CC 81 SCAR 36.8
CC
81
Cov
6%
open
156.0
load_connection
110.0
save_connection
72.0
CRAP 39.6
« dbMan/Extension/CmdSetOracleSpecials.pm ↑ Summary dbMan/Extension/CmdSetSuggestionCache.pm »
1 package DBIx::dbMan::DBI;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use locale;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use vars qw/$AUTOLOAD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use POSIX;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use DBIx::dbMan::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use DBIx::dbMan::MemPool;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 our $VERSION = '0.15';
13  
14 3 1;
15  
16 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
17 0 my $class = shift;
18 0 my $obj = bless { @_ }, $class;
19  
20 0 $obj->clear_all_connections;
21 0 $obj->load_groups();
22 0 $obj->load_connections;
23  
24 0 return $obj;
25 }
26  
27 0 ▶sub connectiondir {
Subroutine connectiondir: not called CC=4 SCAR=30.0
Pod undocumented
28 0 my $obj = shift;
29  
30 0 ▶ return $ENV{ DBMAN_CONNECTIONDIR } if $ENV{ DBMAN_CONNECTIONDIR };
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"DBMAN_CONNECTIONDIR"} 0 0 0
31  
32 0 ▶ return $obj->{ -config }->connection_dir if $obj->{ -config }->connection_dir;
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"-config"}->connection_dir 0 0 0
33  
34 0 ▶ mkdir $ENV{ HOME } . '/.dbman/connections' unless -d $ENV{ HOME } . '/.dbman/connections';
Branch: 1 branch
BranchTrueFalseTotal
unless -d $ENV{"HOME"} . '/.dbman/connections' 0 0 0
35  
36 0 return $ENV{ HOME } . '/.dbman/connections';
37 }
38  
39 0 ▶sub groupdir {
Subroutine groupdir: not called CC=3 SCAR=24.8
Pod undocumented
40 0 my $obj = shift;
41  
42 0 ▶ return $ENV{ DBMAN_GROUPDIR } if $ENV{ DBMAN_GROUPDIR };
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"DBMAN_GROUPDIR"} 0 0 0
43  
44 0 ▶ mkdir $ENV{ HOME } . '/.dbman/groups' unless -d $ENV{ HOME } . '/.dbman/groups';
Branch: 1 branch
BranchTrueFalseTotal
unless -d $ENV{"HOME"} . '/.dbman/groups' 0 0 0
45  
46 0 return $ENV{ HOME } . '/.dbman/groups';
47 }
48  
49 0 ▶sub clear_all_connections {
Subroutine clear_all_connections: not called CC=1 SCAR=6.9
Pod undocumented
50 0 my $obj = shift;
51 0 $obj->{ connections } = {};
52 }
53  
54 0 ▶sub load_group {
Subroutine load_group: not called CC=3 SCAR=24.8
Pod undocumented
55 0 my ( $obj, $name ) = @_;
56  
57 0 my $gdir = $obj->groupdir();
58 0 ▶ return -1 unless -d $gdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $gdir 0 0 0
59 0 $gdir =~ s/\/$//;
60 0 ▶ return -2 unless -f "$gdir/$name";
Branch: 1 branch
BranchTrueFalseTotal
unless -f "$gdir/$name" 0 0 0
61  
62 0 return new DBIx::dbMan::Config -file => "$gdir/$name";
63 }
64  
65 0 ▶sub load_groups {
Subroutine load_groups: not called CC=3 SCAR=24.8
Pod undocumented
66 0 my $obj = shift;
67  
68 0 my $sdir = $obj->groupdir;
69 0 my %groups = ();
70  
71 0 ▶ if ( -d $sdir ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d $sdir) 0 0 0
72 0 opendir S, $sdir;
73 0 for my $group ( grep ! /^\.\.?/, readdir S ) {
74 0 $groups{ $group } = $obj->load_group( $group );
75 }
76 0 closedir S;
77 }
78  
79 0 $obj->{ _groups } = \%groups;
80 }
81  
82 0 ▶sub get_group {
Subroutine get_group: not called CC=1 SCAR=6.9
Pod undocumented
83 0 my ( $obj, $group ) = @_;
84  
85 0 return $obj->{ _groups }->{ $group };
86 }
87  
88 0 ▶sub load_connections {
Subroutine load_connections: not called CC=4 SCAR=30.0
Pod undocumented
89 0 my $obj = shift;
90  
91 0 my $cdir = $obj->connectiondir;
92 0 ▶ return -1 unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
93  
94 0 opendir D, $cdir;
95 0 $obj->load_connection( $_ ) for grep ! /^\.\.?/, readdir D;
96 0 closedir D;
97  
98 0 my $current = '';
99 0 ▶ $current = $obj->{ -config }->current_connection if $obj->{ -config }->current_connection;
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"-config"}->current_connection 0 0 0
100 $obj->{ -interface }->add_to_actionlist(
101 {
102 0 action => 'CONNECTION',
103 operation => 'use', what => $current
104 }
105 );
106 }
107  
108 0 ▶sub load_connection {
Subroutine load_connection: not called CC=10 SCAR=47.0
Pod undocumented
109 0 my ( $obj, $name ) = @_;
110  
111 0 my $cdir = $obj->connectiondir;
112 0 ▶ return -1 unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
113 0 $cdir =~ s/\/$//;
114 0 ▶ return -2 unless -f "$cdir/$name";
Branch: 1 branch
BranchTrueFalseTotal
unless -f "$cdir/$name" 0 0 0
115  
116 0 my $lcfg = new DBIx::dbMan::Config -file => "$cdir/$name";
117  
118 0 my %processed_groups = ();
119 0 ▶ if ( $lcfg->group() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($lcfg->group) 0 0 0
120 0 my $something_processed = 1;
121 0 ▶ while ( $something_processed ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($something_processed) 0 0 0
122 0 $something_processed = 0;
123 0 for ( $lcfg->group() ) {
124 0 ▶ next if $processed_groups{ $_ };
Branch: 1 branch
BranchTrueFalseTotal
if $processed_groups{$_} 0 0 0
125 0 ++$something_processed;
126 0 ▶ print STDERR "Error: Can't use group '$_' for connection '$name'\n" unless $lcfg->merge( $obj->get_group( $_ ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $lcfg->merge($obj->get_group($_)) 0 0 0
127 0 ++$processed_groups{ $_ };
128 }
129 }
130 }
131  
132 0 my %connection;
133 0 $connection{ $_ } = $lcfg->$_ for $lcfg->all_tags;
134 0 $obj->{ connections }->{ $name } = \%connection;
135  
136 $obj->{ -interface }->add_to_actionlist(
137 {
138 0 ▶ action => 'CONNECTION',
Branch: 1 branch
BranchTrueFalseTotal
if lc $lcfg->auto_login eq "yes" 0 0 0
139 operation => 'open', what => $name
140 }
141 ) if lc $lcfg->auto_login eq 'yes';
142 }
143  
144 0 ▶sub open {
Subroutine open: not called CC=12 SCAR=50.5
Pod undocumented
145 0 my ( $obj, $name ) = @_;
146  
147 0 ▶ return -3 unless exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$name} 0 0 0
148 0 ▶ return -4 if $obj->{ connections }->{ $name }->{ -logged };
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"connections"}{$name}{"-logged"} 0 0 0
149 0 ▶ return -1 unless grep { $_ eq $obj->{ connections }->{ $name }->{ driver } } $obj->driverlist;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$_ eq $obj->{"connections"}{$name}{"driver"};} $obj->driverlist 0 0 0
150  
151 0 my %vars = qw/PrintError 0 RaiseError 0 AutoCommit 1 LongTruncOk 1/;
152  
153 # in case Oracle we need from 11R2 provide information about supported signals
154 0 ▶ if ( $obj->{ connections }->{ $name }->{ driver } eq 'Oracle' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->{"connections"}{$name}{"driver"} eq "Oracle") 0 0 0
155 0 $vars{ ora_connect_with_default_signals } = [ 'INT' ];
156 }
157  
158 0 ▶ if ( $obj->{ connections }->{ $name }->{ config } ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->{"connections"}{$name}{"config"}) 0 0 0
159 0 for ( split /;\s*/, $obj->{ connections }->{ $name }->{ config } ) {
160 0 ▶ if ( /^\s*(\S+?)\s*=\s*(\S+)\s*$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^\s*(\S+?)\s*=\s*(\S+)\s*$/l) 0 0 0
161 0 my ( $var, $val ) = ( $1, $2 );
162 0 ▶ next if $var eq 'AutoCommit'; # everything unless transactions
Branch: 1 branch
BranchTrueFalseTotal
if $var eq "AutoCommit" 0 0 0
163 0 ▶ $val = eval $val if $val =~ /^\[(.*)\]$/ || $val =~ /^\{(.*)\}$/;
Branch: 1 branch
BranchTrueFalseTotal
if $val =~ /^\[(.*)\]$/l or $val =~ /^\{(.*)\}$/l 0 0 0
Condition0%0/3
$val =~ /^\[(.*)\]$/l or $val =~ /^\{(.*)\}$/l
l!l&&r!l&&!r
000
MC/DC0%0/2
$val =~ /^\[(.*)\]$/l or $val =~ /^\{(.*)\}$/l
$val =~ /^\[(.*)\]$/l $val =~ /^\{(.*)\}$/l
Truth table0%0/3
A or B
A= $val =~ /^\[(.*)\]$/lB= $val =~ /^\{(.*)\}$/l
ABresult
1X1
011
000
164 0 $vars{ $var } = $val;
165 }
166 }
167 }
168  
169 my $dbi = DBI->connect(
170 'dbi:' . $obj->{ connections }->{ $name }->{ driver } . ':' . $obj->{ connections }->{ $name }->{ dsn },
171 $obj->{ connections }->{ $name }->{ login },
172 $obj->{ connections }->{ $name }->{ password },
173 0 \%vars
174 );
175  
176 0 ▶ return -2 unless defined $dbi;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dbi 0 0 0
177  
178 0 $obj->{ connections }->{ $name }->{ -dbi } = $dbi;
179 0 $obj->{ connections }->{ $name }->{ -mempool } = new DBIx::dbMan::MemPool;
180 0 $obj->{ connections }->{ $name }->{ -logged } = 1;
181 0 $obj->{ -interface }->add_to_actionlist( { action => 'AUTO_SQL', connection => $name } );
182  
183 0 return 0;
184 }
185  
186 0 ▶sub driverlist {
Subroutine driverlist: not called CC=1 SCAR=6.9
Pod undocumented
187 0 my $obj = shift;
188 0 return DBI->available_drivers;
189 }
190  
191 0 ▶sub close {
Subroutine close: not called CC=4 SCAR=30.0
Pod undocumented
192 0 my ( $obj, $name ) = @_;
193  
194 0 ▶ return -1 unless exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$name} 0 0 0
195 0 ▶ return -2 unless $obj->{ connections }->{ $name }->{ -logged };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"connections"}{$name}{"-logged"} 0 0 0
196  
197 0 ▶ $obj->set_current() if $obj->{ current } eq $name;
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"current"} eq $name 0 0 0
198 0 $obj->discard_profile_data();
199 0 delete $obj->{ connections }->{ $name }->{ -logged };
200 0 $obj->{ connections }->{ $name }->{ -dbi }->disconnect();
201 0 undef $obj->{ connections }->{ $name }->{ -dbi };
202 0 undef $obj->{ connections }->{ $name }->{ -mempool };
203  
204 0 return 0;
205 }
206  
207 0 ▶sub close_all {
Subroutine close_all: not called CC=3 SCAR=24.8
Pod undocumented
208 0 my $obj = shift;
209 0 for my $name ( keys %{ $obj->{ connections } } ) {
210 0 ▶ if ( $obj->{ connections }->{ $name }->{ -logged } ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->{"connections"}{$name}{"-logged"}) 0 0 0
211 0 $obj->close( $name );
212 0 $obj->{ -interface }->print( "Disconnected from $name.\n" );
213  
214 # we can't move this message to extension - close_all called when
215 # destroying DBI object (handle event collapsed :(, no OUTPUT event exist)
216 }
217 }
218 }
219  
220 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=1 SCAR=6.9
221 0 my $obj = shift;
222 0 $obj->close_all;
223 }
224  
225 0 ▶sub list {
Subroutine list: not called CC=6 SCAR=37.4
Pod undocumented
226 0 my ( $obj, $what ) = @_;
227 0 my @returned = ();
228  
229 0 for my $name ( keys %{ $obj->{ connections } } ) {
230 0 my %r = %{ $obj->{ connections }->{ $name } };
231 0 ▶ next if ( $what eq 'inactive' and $r{ -logged } ) || ( $what eq 'active' and ! $r{ -logged } );
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "inactive" and $r{"-logged"} or $what eq "active" and not $r{"-logged"} 0 0 0
Condition0%0/9
$what eq "inactive" and $r{"-logged"} or $what eq "active" and not $r{"-logged"}
l!l&&r!l&&!r
000
$what eq "inactive" and $r{"-logged"}
!ll&&!rl&&r
000
$what eq "active" and not $r{"-logged"}
!ll&&!rl&&r
000
MC/DC0%0/4
$what eq "inactive" and $r{"-logged"} or $what eq "active" and not $r{"-logged"}
$what eq "inactive" $r{"-logged"} $what eq "active" not $r{"-logged"}
Truth table0%0/7
A and B or C and not(D)
A= $what eq "inactive"B= $r{"-logged"}C= $what eq "active"D= not $r{"-logged"}
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
232 0 $r{ name } = $name;
233 0 push @returned, \%r;
234 }
235  
236 0 return [ sort { $a->{ name } cmp $b->{ name } } @returned ];
237 }
238  
239 0 ▶sub autosql {
Subroutine autosql: not called CC=3 SCAR=24.8
Pod undocumented
240 0 my $obj = shift;
241  
242 0 ▶ return -1 unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
243 0 ▶ return -2 unless exists $obj->{ connections }->{ $obj->{ current } };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$obj->{"current"}} 0 0 0
244 0 return $obj->{ connections }->{ $obj->{ current } }->{ autosql };
245 }
246  
247 0 ▶sub silent_autosql {
Subroutine silent_autosql: not called CC=3 SCAR=24.8
Pod undocumented
248 0 my $obj = shift;
249  
250 0 ▶ return -1 unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
251 0 ▶ return -2 unless exists $obj->{ connections }->{ $obj->{ current } };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$obj->{"current"}} 0 0 0
252 0 return $obj->{ connections }->{ $obj->{ current } }->{ silent_autosql };
253 }
254  
255 0 ▶sub set_current {
Subroutine set_current: not called CC=5 SCAR=34.0
Pod undocumented
256 0 my ( $obj, $name ) = @_;
257  
258 0 ▶ return 9999 if $obj->{ current } eq $name;
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"current"} eq $name 0 0 0
259  
260 0 ▶ unless ( $name ) { delete $obj->{ current }; return 1; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($name) 0 0 0
261  
262 0 ▶ return -1 unless exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$name} 0 0 0
263 0 ▶ return -2 unless $obj->{ connections }->{ $name }->{ -logged };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"connections"}{$name}{"-logged"} 0 0 0
264  
265 0 $obj->{ current } = $name;
266 0 return 0;
267 }
268  
269 0 ▶sub current {
Subroutine current: not called CC=1 SCAR=6.9
Pod undocumented
270 0 my $obj = shift;
271 0 return $obj->{ current };
272 }
273  
274 0 ▶sub drop_connection {
Subroutine drop_connection: not called CC=3 SCAR=24.8
Pod undocumented
275 0 my ( $obj, $name ) = @_;
276 0 ▶ return -1 unless exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$name} 0 0 0
277 0 ▶ $obj->close( $name ) if $obj->{ connections }->{ $name }->{ -logged };
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"connections"}{$name}{"-logged"} 0 0 0
278 0 delete $obj->{ connections }->{ $name };
279 0 return 0;
280 }
281  
282 0 ▶sub create_connection {
Subroutine create_connection: not called CC=3 SCAR=24.8
Pod undocumented
283 0 my ( $obj, $name, $p ) = @_;
284 0 my %parms = %$p;
285  
286 0 ▶ return -1 if exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
if exists $obj->{"connections"}{$name} 0 0 0
287  
288 0 $obj->{ connections }->{ $name } = \%parms;
289 0 ▶ return 100 + $obj->open( $name ) if lc $parms{ auto_login } eq 'yes';
Branch: 1 branch
BranchTrueFalseTotal
if lc $parms{"auto_login"} eq "yes" 0 0 0
290 0 return 0;
291 }
292  
293 0 ▶sub save_connection {
Subroutine save_connection: not called CC=8 SCAR=42.8
Pod undocumented
294 0 my $obj = shift;
295 0 my $name = shift;
296  
297 0 ▶ return -1 unless exists $obj->{ connections }->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$name} 0 0 0
298  
299 0 my $cdir = $obj->connectiondir;
300 0 ▶ mkdir $cdir unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
301 0 ▶ return -1 unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
302 0 $cdir =~ s/\/$//;
303 0 ▶ CORE::open F, ">$cdir/$name" or return -2;
Branch: 1 branch
BranchTrueFalseTotal
CORE::open F, ">$cdir/$name" or return -2 0 0 0
304 0 for ( qw/driver dsn login password auto_login config/ ) {
305 print F "$_ " . $obj->{ connections }->{ $name }->{ $_ } . "\n"
306 if exists $obj->{ connections }->{ $name }->{ $_ }
307 0 ▶ and $obj->{ connections }->{ $name }->{ $_ } ne '';
Branch: 1 branch
BranchTrueFalseTotal
if exists $obj->{"connections"}{$name}{$_} and $obj->{"connections"}{$name}{$_} ne "" 0 0 0
Condition0%0/3
exists $obj->{"connections"}{$name}{$_} and $obj->{"connections"}{$name}{$_} ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
exists $obj->{"connections"}{$name}{$_} and $obj->{"connections"}{$name}{$_} ne ""
exists $obj->{"connections"}{$name}{$_} $obj->{"connections"}{$name}{$_} ne ""
Truth table0%0/3
A and B
A= exists $obj->{"connections"}{$name}{$_}B= $obj->{"connections"}{$name}{$_} ne ""
ABresult
0X0
100
111
308 }
309 0 CORE::close F;
310 0 chmod 0600, "$cdir/$name";
311 0 return 0;
312 }
313  
314 0 ▶sub destroy_connection {
Subroutine destroy_connection: not called CC=4 SCAR=30.0
Pod undocumented
315 0 my $obj = shift;
316 0 my $name = shift;
317  
318 0 my $cdir = $obj->connectiondir;
319 0 ▶ return -1 unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
320 0 $cdir =~ s/\/$//;
321 0 ▶ return 1 unless -e "$cdir/$name";
Branch: 1 branch
BranchTrueFalseTotal
unless -e "$cdir/$name" 0 0 0
322 0 unlink "$cdir/$name";
323 0 ▶ return -2 if -e "$cdir/$name";
Branch: 1 branch
BranchTrueFalseTotal
if -e "$cdir/$name" 0 0 0
324 0 return 0;
325 }
326  
327 0 ▶sub is_permanent_connection {
Subroutine is_permanent_connection: not called CC=2 SCAR=17.9
Pod undocumented
328 0 my $obj = shift;
329 0 my $name = shift;
330 0 my $cdir = $obj->connectiondir;
331 0 ▶ return 0 unless -d $cdir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $cdir 0 0 0
332 0 $cdir =~ s/\/$//;
333 0 return -e "$cdir/$name";
334 }
335  
336 0 ▶sub trans_begin {
Subroutine trans_begin: not called CC=2 SCAR=17.9
Pod undocumented
337 0 my $obj = shift;
338 0 ▶ return -1 unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
339 0 $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ AutoCommit } = 0;
340 }
341  
342 0 ▶sub longreadlen {
Subroutine longreadlen: not called CC=2 SCAR=17.9
Pod undocumented
343 0 my $obj = shift;
344 0 my $long = shift;
345 0 ▶ $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ LongReadLen } = $long if $long;
Branch: 1 branch
BranchTrueFalseTotal
if $long 0 0 0
346 0 return $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ LongReadLen };
347 }
348  
349 0 ▶sub trans_end {
Subroutine trans_end: not called CC=2 SCAR=17.9
Pod undocumented
350 0 my $obj = shift;
351 0 ▶ return -1 unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
352 0 $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ AutoCommit } = 1;
353 }
354  
355 0 ▶sub in_transaction {
Subroutine in_transaction: not called CC=2 SCAR=17.9
Pod undocumented
356 0 my $obj = shift;
357 0 ▶ return 0 unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
358 0 return not $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ AutoCommit };
359 }
360  
361 0 ▶sub driver {
Subroutine driver: not called CC=2 SCAR=17.9
Pod undocumented
362 0 my $obj = shift;
363 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
364 0 return $obj->{ connections }->{ $obj->{ current } }->{ driver };
365 }
366  
367 0 ▶sub login {
Subroutine login: not called CC=2 SCAR=17.9
Pod undocumented
368 0 my $obj = shift;
369 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
370 0 return $obj->{ connections }->{ $obj->{ current } }->{ login };
371 }
372  
373 0 ▶sub prompt_color {
Subroutine prompt_color: not called CC=2 SCAR=17.9
Pod undocumented
374 0 my $obj = shift;
375 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
376 0 return $obj->{ connections }->{ $obj->{ current } }->{ prompt_color };
377 }
378  
379 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=5 SCAR=34.0
380 0 my $obj = shift;
381  
382 0 $AUTOLOAD =~ s/^DBIx::dbMan::DBI:://g;
383 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
384 0 ▶ return undef unless exists $obj->{ connections }->{ $obj->{ current } };
Branch: 1 branch
BranchTrueFalseTotal
unless exists $obj->{"connections"}{$obj->{"current"}} 0 0 0
385 0 ▶ return undef unless $obj->{ connections }->{ $obj->{ current } }->{ -logged };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"connections"}{$obj->{"current"}}{"-logged"} 0 0 0
386 0 ▶ return undef unless defined $obj->{ connections }->{ $obj->{ current } }->{ -dbi };
Branch: 1 branch
BranchTrueFalseTotal
unless defined $obj->{"connections"}{$obj->{"current"}}{"-dbi"} 0 0 0
387  
388 0 my $dbi = $obj->{ connections }->{ $obj->{ current } }->{ -dbi };
389  
390 0 return $dbi->$AUTOLOAD( @_ );
391 }
392  
393 0 ▶sub set {
Subroutine set: not called CC=2 SCAR=17.9
Pod undocumented
394 0 my ( $obj, $var, $val ) = @_;
395 0 ▶ return unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
396  
397 0 $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ $var } = $val;
398 }
399  
400 0 ▶sub get {
Subroutine get: not called CC=2 SCAR=17.9
Pod undocumented
401 0 my ( $obj, $var ) = @_;
402 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
403 0 return $obj->{ connections }->{ $obj->{ current } }->{ -dbi }->{ $var };
404 }
405  
406 0 ▶sub discard_profile_data {
Subroutine discard_profile_data: not called CC=2 SCAR=17.9
Pod undocumented
407 0 my $obj = shift;
408 0 ▶ return unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
409  
410 # $obj->{connections}->{$obj->{current}}->{-dbi}->{Profile}->{Data} = undef;
411 }
412  
413 0 ▶sub mempool {
Subroutine mempool: not called CC=2 SCAR=17.9
Pod undocumented
414 0 my $obj = shift;
415 0 ▶ return undef unless $obj->{ current };
Branch: 1 branch
BranchTrueFalseTotal
unless $obj->{"current"} 0 0 0
416 0 return $obj->{ connections }->{ $obj->{ current } }->{ -mempool };
417 }
« dbMan/Extension/CmdSetOracleSpecials.pm ↑ Summary dbMan/Extension/CmdSetSuggestionCache.pm »