GenOO::Data::DB::DBIC::Species::Schema - Schema object
# All the database manipulation with DBIx::Class is done via one central Schema object # which maintains the connection to the database. This class inherits from DBIx::Class::Schema # and loads the tables with sequencing reads automatically. # To create a schema object, call connect on GenOO::Data::DB::DBIC::Species::Schema, passing it a Data Source Name. GenOO::Data::DB::DBIC::Species::Schema->connect("$connection_string");
-- Requesting a resultset with "sample_resultset" In High Troughput Sequencing analysis we usually have many db tables with similar structure and columns. Unfortunalely, DBIx::Class requires each Result class to specify the table name explicitly which means that we would have to explicitly create a Result class for every db table. To avoid this, upon request we dynamically create (meta-programming) a new Result class for the provided table name. The new Result class inherits the table structure from a base class which is also provided. One can also hard code a Result class under the namespace GenOO::Data::DB::DBIC::Species::Schema::Result and it will also be registered under the schema. The implementation follows draegtun suggestion in L<http://stackoverflow.com/questions/14515153/use-dbixclass-with-a-single-result-class-definition-to-handle-several-tables-w>
my $schema = GenOO::Data::DB::DBIC::Species::Schema->connect("dbi:mysql:dbname=$database;host=$host;", $user, $pass); my $result_set = $schema->resultset('sample_table_name');
To install GenOO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GenOO
CPAN shell
perl -MCPAN -e shell install GenOO
For more information on module installation, please visit the detailed CPAN module installation guide.