dbMan/Extension/DescribeCompleteOracle.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 57 CC 4 SCAR 23.0
CC
4
Cov
0%
handle_action
20.0
IDENTIFICATION
2.0
preference
2.0
CRAP 10.0
1 package DBIx::dbMan::Extension::DescribeCompleteOracle;
2  
3 use strict;
4 use base 'DBIx::dbMan::Extension';
5  
6 our $VERSION = '0.04';
7  
8 1;
9  
10 sub IDENTIFICATION { return "000001-000049-000004"; }
11  
12 sub preference { return 1000; }
13  
14 sub known_actions { return [ qw/DESCRIBE/ ]; }
15  
16 sub handle_action {
17 my ($obj,%action) = @_;
18  
19 if ($action{action} eq 'DESCRIBE' and $action{oper} eq 'complete' and $obj->{-dbi}->driver eq 'Oracle') {
20 $action{action} = 'CACHE';
21 $action{cache_type} = 'describe_ora';
22  
23 unless ($obj->{-dbi}->current) {
24 $obj->{-interface}->error("No current connection selected.");
25 return %action;
26 }
27 my $sth = $obj->{-dbi}->prepare(q!SELECT object_name FROM user_objects WHERE object_type IN ('TABLE','VIEW')!);
28 $sth->execute();
29 my $ret = $sth->fetchall_arrayref();
30 my @all = ();
31 @all = map { $_->[0] } @$ret if defined $ret;
32 $sth->finish;
33 $action{list} = \@all;
34 $action{what} = 'list';
35 $action{processed} = 1;
36 return %action;
37 }
38  
39 $action{processed} = 1;
40 return %action;
41 }