Goo::DatabaseInfo - Simple access to the database schema


Goo documentation Contained in the Goo distribution.

Index


Code Index:

NAME

Top

Goo::DatabaseInfo - Simple access to the database schema

SYNOPSIS

Top

use Goo::DatabaseInfo;

DESCRIPTION

Top

METHODS

Top

BEGIN

look up all the tables in the database

get_table_info

return a table info object for a given table

AUTHOR

Top

Nigel Hamilton <nigel@trexy.com>

SEE ALSO

Top


Goo documentation Contained in the Goo distribution.

package Goo::DatabaseInfo;

###############################################################################
# Nigel Hamilton
#
# Copyright Nigel Hamilton 2005
# All Rights Reserved
#
# Author:       Nigel Hamilton
# Filename:     GooDatabaseInfo.pm
# Description:  Find out all the database info at once!
#
# Date          Change
# -----------------------------------------------------------------------------
# 30/04/2005    Auto generated file
# 30/04/2005    Needed for speed!
#
###############################################################################

use strict;

use Goo::TableInfo;

our $tables;


###############################################################################
#
# BEGIN - look up all the tables
#
###############################################################################

sub BEGIN {

    # could use Database::getTables for the full DB -- but took a few
    # seconds to populate in the interests of speed and RAM consumption
    # decided to start off with a simple registry instead
    my @registry = qw(tasks bugs);

    foreach my $table (@registry) {

        # print "looking up $table \n";
        $tables->{$table} = TableInfo->new($table);
    }

}


###############################################################################
#
# get_table_info - return a table info object
#
###############################################################################

sub get_table_info {

    my ($table) = @_;

    return $tables->{$table};

}


1;


__END__