Class::DBI::Lite::TableInfo - Utility class for database table meta-information.



NAME

Class::DBI::Lite::TableInfo - Utility class for database table meta-information.


SYNOPSIS

  # Methods:
  my $info = Class::DBI::Lite::TableInfo->new( 'users' );
  $info->add_column(
    name          => 'user_id',
    type          => 'integer',
    length        => 10,
    is_nullable   => 0,
    default_value => undef,
    is_pk         => 1,
    key           => 'primary_key',
  );
  my $col = $info->column( 'user_id' );
  
  # Properties:
  my @cols = $info->columns();
  print $info->table; # "users"


DESCRIPTION

Class::DBI::Lite::TableInfo provides a consistent means to discover the meta-info about tables and their fields in a database.


PUBLIC PROPERTIES

table

Returns the name of the table.

columns

Returns a list of the Class::DBI::Lite::ColumnInfo manpage objects that pertain to the current table.


PUBLIC METHODS

new( $table_name )

Returns a new Class::DBI::Lite::TableInfo object for the table named $table_name.

column( $name )

Returns a the Class::DBI::Lite:ColumnInfo manpage object that matches $name.

add_column( %args )

Adds a new the Class::DBI::Lite::ColumnInfo manpage object to the table's collection.

%args is passed to the the Class::DBI::Lite::ColumnInfo manpage constructor and should contain its required parameters.


AUTHOR

John Drago <jdrago_999@yahoo.com>

http://www.devstack.com/


COPYRIGHT AND LICENSE

Copyright 2008 John Drago <jdrago_999@yahoo.com>, All Rights Reserved.

This software is Free software and may be used and redistributed under the same terms as perl itself.

 Class::DBI::Lite::TableInfo - Utility class for database table meta-information.