line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Goo::DatabaseInfo; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Nigel Hamilton |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
7
|
|
|
|
|
|
|
# All Rights Reserved |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
10
|
|
|
|
|
|
|
# Filename: GooDatabaseInfo.pm |
11
|
|
|
|
|
|
|
# Description: Find out all the database info at once! |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Date Change |
14
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# 30/04/2005 Auto generated file |
16
|
|
|
|
|
|
|
# 30/04/2005 Needed for speed! |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
############################################################################### |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
12133
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
58
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
838
|
use Goo::TableInfo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
86
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $tables; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
############################################################################### |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
# BEGIN - look up all the tables |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
############################################################################### |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub BEGIN { |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# could use Database::getTables for the full DB -- but took a few |
36
|
|
|
|
|
|
|
# seconds to populate in the interests of speed and RAM consumption |
37
|
|
|
|
|
|
|
# decided to start off with a simple registry instead |
38
|
1
|
|
|
1
|
|
3
|
my @registry = qw(tasks bugs); |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
3
|
foreach my $table (@registry) { |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# print "looking up $table \n"; |
43
|
1
|
|
|
|
|
59
|
$tables->{$table} = TableInfo->new($table); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
############################################################################### |
50
|
|
|
|
|
|
|
# |
51
|
|
|
|
|
|
|
# get_table_info - return a table info object |
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
############################################################################### |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub get_table_info { |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my ($table) = @_; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return $tables->{$table}; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 NAME |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Goo::DatabaseInfo - Simple access to the database schema |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
use Goo::DatabaseInfo; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 DESCRIPTION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 METHODS |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=over |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item BEGIN |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
look up all the tables in the database |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item get_table_info |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
return a table info object for a given table |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 SEE ALSO |
99
|
|
|
|
|
|
|
|