Jifty::DBI::Collection

Encapsulate SQL queries and rows in simple Perl objects
Download

Jifty::DBI::Collection Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jesse Vincent, Alex Vandiver and Ruslan Zakirov
  • Publisher web site:
  • http://search.cpan.org/~sartak/

Jifty::DBI::Collection Tags


Jifty::DBI::Collection Description

Encapsulate SQL queries and rows in simple Perl objects Jifty::DBI::Collection is a Perl module to encapsulate SQL queries and rows in simple Perl objects.SYNOPSIS use Jifty::DBI::Collection; package My::ThingCollection; use base qw/Jifty::DBI::Collection/; package My::Thing; use Jifty::DBI::Schema; use Jifty::DBI::Record schema { column column_1 => type is 'text'; }; package main; use Jifty::DBI::Handle; my $handle = Jifty::DBI::Handle->new(); $handle->connect( driver => 'SQLite', database => "my_test_db" ); my $collection = My::ThingCollection->new( handle => $handle ); $collection->limit( column => "column_1", value => "matchstring" ); while ( my $record = $collection->next ) { print $record->id; }This module provides an object-oriented mechanism for retrieving and updating data in a DBI-accessible database.In order to use this module, you should create a subclass of Jifty::DBI::Collection and a subclass of Jifty::DBI::Record for each table that you wish to access. (See the documentation of Jifty::DBI::Record for more information on subclassing it.)Your Jifty::DBI::Collection subclass must override "new_item", and probably should override at least "_init" also; at the very least, "_init" should probably call "_handle" and "_table" to set the database handle (a Jifty::DBI::Handle object) and table name for the class -- see the "SYNOPSIS" for an example. Requirements: · Perl


Jifty::DBI::Collection Related Software