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

Name

File::DataClass::ResultSource - A source of result sets for a given schema

Synopsis

   use File::DataClass::Schema;

   $schema = File::DataClass::Schema->new
      ( path    => [ qw(path to a file) ],
        result_source_attributes => { source_name => {}, },
        tempdir => [ qw(path to a directory) ] );

   $schema->source( q(source_name) )->attributes( [ qw(list of attr names) ] );
   $rs = $schema->resultset( q(source_name) );
   $result = $rs->find( { name => q(id of field element to find) } );
   $result->$attr_name( $some_new_value );
   $result->update;
   @result = $rs->search( { 'attr name' => q(some value) } );

Description

Provides new result sources for a given schema

This is the base class for schema definitions. Each element in a data file requires a schema definition to define it's attributes that should inherit from this

Configuration and Environment

Defines the following attributes

attributes

Array ref of attributes defined in this result source

defaults
name
label_attr
resultset_attributes
resultset_class
schema
storage

Subroutines/Methods

columns

   @attributes = $self->columns;

Returns a list of attributes

has_column

   $bool = $self->has_column( $attribute_name );

Predicate return true if the attribute exists, false otherwise

resultset

   $rs = $self->resultset;

Creates and returns a new File::DataClass::ResultSet object

Diagnostics

None

Dependencies

File::DataClass::ResultSet

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2014 Peter Flanigan. All rights reserved

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

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE