Author image Masatoshi Mizuno
and 1 contributors


Egg::Model::DBIC - Model for DBIx::Class.


  my $schema= $e->model('dbic::myschema');
  # If the transaction is effective.
  my $table= $schema->resultset('hoge_master');
  my $table= $e->model('dbic::myschema::hoge_master');
  $table->search( ... );
  # And.


It is MODEL to use DBIx::Class.

A series of Schema module is generated by using the helper for use.

  % cd /path/to/MyApp/bin
  % ./ M::DBIC [SCHEMA_NAME] -d dbi:SQLite:dbname=dbfile -u user -p passwd

The name that can be used as Perl module name in the part of SCHEMA_NAME is passed.

The option to continue is not indispensable.

Details are Egg::Helper::Model::DBIC. Please drink and refer to the document.

And, 'DBIC' is added to the MODEL setting of the project.

  % vi /path/to/MyApp/lib/MyApp/
  MODEL => ['DBIC'],

Using this model by this becomes possible.

When the object of Schema is acquired from the application, as follows is done.

  my $schema= $e->model('dbic::schema_name');

The object to which DBIx::Class::Schema is succeeded to by this can be received.

And, the object of the table does as follows.

  my $table = $e->model('dbic::schema_name::table_name');
  # If you have already acquired the Schema object.
  my $table = $schema->resultset('table_name');

The object to which DBIx::Class::ResultSet is succeeded to by this can be received.


Egg::Release, Egg::Model, Egg::Model::DBIC::Base, Egg::Helper::Model::DBIC, DBIx::Class, DBIx::Class::Schema, DBIx::Class::ResultSet, UNIVERSAL::require,


Masatoshi Mizuno, <>


Copyright (C) 2008 Bee Flag, Corp. <>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.