FeyX::Active::Table - An active Fey Table


FeyX-Active documentation  | view source Contained in the FeyX-Active distribution.

Index


NAME

Top

FeyX::Active::Table - An active Fey Table

SYNOPSIS

Top

  use FeyX::Active::Table;

  my $Person = FeyX::Active::Table->new(name => 'Person');
  $Person->add_column( Fey::Column->new( name => 'first_name', type => 'varchar' ) );
  $Person->add_column( Fey::Column->new( name => 'last_name',  type => 'varchar' ) );

  $schema->add_table( $Person );

  my @people = (
      { first_name  => 'Homer', last_name => 'Simpson' },
      { first_name  => 'Marge', last_name => 'Simpson' },
      { first_name  => 'Bart',  last_name => 'Simpson' },
  );

  foreach my $person (@people) {
      $Person->insert( %$person )->execute;
  }

  my ($first_name, $last_name) = $Person->select
                                        ->where( $Person->column('first_name'), '==', 'Homer' )
                                        ->execute
                                        ->fetchrow;

DESCRIPTION

Top

This is a subclass of Fey::Table that adds a couple methods for creating FeyX::Active::SQL objects.

METHODS

Top

All these methods will pass the default_source database handle from the associated FeyX::Active::Schema to the FeyX::Active::SQL object it creates.

select ( ?@columns )

This will create a FeyX::Active::SQL::Select object which that will execute against the table associated. You can either pass in a list of Fey::Column objects to be passed to the select method, or pass in nothing which will be interpreted as selecting all the columns.

delete

This will create a FeyX::Active::SQL::Delete object which that will execute against the table associated.

insert ( ?@values )

This will create a FeyX::Active::SQL::Insert object which that will execute against the table associated. You can optionally pass in the set of values you wish to insert and they will be passed to the values method.

update ( ?@values )

This will create a FeyX::Active::SQL::Update object which that will execute against the table associated. You can optionally pass in the set of values you wish to update and they will be passed to the set method.

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE

Top


FeyX-Active documentation  | view source Contained in the FeyX-Active distribution.