++ed by:
Stevan Little


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


  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' )


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.




Stevan Little <stevan.little@iinteractive.com>


Copyright 2009-2010 Infinity Interactive, Inc.



Hosting generously
sponsored by Bytemark