The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::SQLEngine::Record::Trait::Extras - Provide extra methods

SYNOPSIS

  package My::Record;
  use DBIx::SQLEngine::Record::Class '-isasubclass', 'Extras';
  
  my $sqldb = DBIx::SQLEngine->new( ... );
  My::Record->table( $sqldb->table( 'foo' ) );

DESCRIPTION

This package provides a multiply-composable collection of functionality for Record classes.

Don't use this module directly; instead, pass its name as a trait when you create a new record class. This package provides a multiply-composable collection of functionality for Record classes. It is combined with the base class and other traits by DBIx::SQLEngine::Record::Class.

REFERENCE

Selecting Records

fetch_records
  $recordset = My::Students->fetch_records( criteria => {status=>'active'} );

Fetch all matching records and return them in a RecordSet.

fetch_one
  $dave = My::Students->fetch_one( criteria => { name => 'Dave' } );

Fetch a single matching record.

fetch_id
  $prisoner = My::Students->fetch_id( 6 );

Fetch a single record based on its primary key.

visit_records
  @results = My::Students->visit_records( \&mysub, criteria=> ... );

Calls the provided subroutine on each matching record as it is retrieved. Returns the accumulated results of each subroutine call (in list context).

refetch_record
  $record->refetch_record();

Re-retrieve the values for this record from the database based on its primary key.