This mixin gives you an accessor which returns the DBIx::Class schema object for your data model. It expects dbconn, dbuser, and dbpass to be in your site conf, so it can call fish config to get them. If you use get_auth_schema, it expects auth_dbconn, auth_dbuser and auth_dbpass to be in your site conf.

In order for this module to help you, your model (and/or auth model) must provide one helper:

This supplies the default DBI parameters to the connection method. This is usually sufficient:

sub get_db_options { return {}; }

Note that the return value must be a hash reference.

If you model inherits from Gantry::Utils::DBIxClass, it will have a family of convenience methods meant to reduce typing. These are the same methods DBIx::Class makes available through resultsets, but with a couple of twists. First, the names of the methods have a g in front. Second, the g methods expect to be called as class methods on the model. Third, the g methods expect the Gantry site object as their first (non-invoking) parameter. The rest of the parameters are the same as for the corresponding call via a DBIC resultset.

Note that for the g methods to work on the model, your site object must use this mixin. The g methods call get_schema.

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.