Stevan Little > FeyX-Active-0.03 > FeyX::Active

Download:
FeyX-Active-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

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

SYNOPSIS ^

  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 ^

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 ^

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 ^

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE ^

Copyright 2009-2010 Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: