Renée Bäcker > FabForce-DBDesigner4 > FabForce::DBDesigner4::Table

Download:
FabForce-DBDesigner4-0.33.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Stalled  1
View/Report Bugs
Module Version: 0.07   Source  

NAME ^

FabForce::DBDesigner4::Table

VERSION ^

version 0.33

DBDesigner4::Table ^

Each table is an object which contains information about the columns, the relations and the keys.

Methods of the table-objects

name

  # set the tablename
  $table->name('tablename');
  # get the tablename
  my $name = $table->name();

columns

  # set the tablecolumns
  my @array = ({'column1' => ['int','not null']});
  $table->columns(\@array);
  
  # get the columns
  print $_,"\n" for($table->columns());

columnType

  # get datatype of n-th column (i.e. 3rd column)
  my $datatype = $table->columnType(3);

columnInfo

  # get info about n-th column (i.e. 4th column)
  print Dumper($table->columnInfo(4));

stringsToTableCols

  # maps column information to hash (needed for columns())
  my @columns = ('col1 varchar(255) primary key', 'col2 int not null');
  my @array   = $table->stringsToTableCols(@columns);

addColumn

  # add the tablecolumn
  my $column = ['column1','int','not null'];
  $table->addColumn($column);

relations

  # set relations
  my @relations = ([1,'startTable.startCol','targetTable.targetCol']);
  $table->relations(\@relations);
  # get relations
  print $_,"\n" for($table->relations());

addRelation

  $table->addRelation([1,'startTable.startCol','targetTable.targetCol']);

removeRelation

  # removes a relation (i.e. 2nd relation)
  $table->removeRelation(2);

key

  # set the primary key
  $table->key(['prim1']);
  # get the primary key
  print "the primary key contains these columns:\n";
  print $_,"\n" for($table->key());

attribute

changeRelation

coords

new

tableIndex

column_details

column_names

  my @names = $table->column_names
  print $_,"\n" for @names;

get_foreign_keys

  my %foreign_keys = $table->get_foreign_keys;
  use Data::Dumper;
  print Dumper \%foreign_keys;

AUTHOR ^

Renee Baecker <module@renee-baecker.de>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2010 by Renee Baecker.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: