FeyX::Active - An extension to Fey for active tables


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

Index


NAME

Top

FeyX::Active - An extension to Fey for active tables

SYNOPSIS

Top

  use Fey;
  use FeyX::Active;

  my $schema = FeyX::Active::Schema->new( name => 'MySchema' );

  $schema->dbi_manager->add_source( dsn => 'dbi:SQLite:dbname=foo' );

  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 module extends the Fey module to allow Fey table objects to have an active database handle so that the SQL objects that Fey creates can actually be executed.

You can think of this module as a bridge between Fey which only deals with SQL code generation and Fey::ORM which is a full fledged Object-Relational Mapping tool. Sometimes you don't need to inflate your data into objects, but only need a simple way to execute SQL, if that is the case, this may be the module for you.

This module aims to DWIM (Do What I Mean) in most cases and keep itself as simple as possible. The real power is in the Fey modules that this extends, so if you don't see something here, go look there.

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.