
Catalyst::Model::DBIS - DBIx::Simple model class

$c->model('DBIS')->insert('test_log_db', {
user_agent => $c->req->user_agent,
insert_datetime => ['NOW()'],
});
$c->stash->{users} = $c->model('DBIS')->select(
'tickets', '*', {
status => $c->req->param('status') || 0,
},
)->hashes;
$c->model('DBIS')->query('SELECT 1 + 1')->into( $c->stash->{answer} );

Note: This is a super simple DBIx::Simple model. If you're interested this, Catalyst::Model::DBIC::Schema help you I promise. Catalyst::Model::DBIS will be deprecated.

Using helper...(see Catalyst::Helper::Model::DBIS)
% ./script/myapp_create.pl model DBIS DBIS dsn user password
Or manually create in lib/MyApp/Model/DBIS.pm
package MyApp::Model::DBIS;
use strict;
use base 'Catalyst::Model::DBIS';
__PACKAGE__->config(
connect_info => [
'dbi:mysql:myapp_db',
'myapp_user',
'myapp_pass',
{ RaiseError => 1 },
{ on_connect_do => [ 'set names utf8' ] },
],
);
1;

In lib/MyApp/Model/DBIS.pm as above, or in myapp.yaml file like this.
Model::DBIS:
connect_info:
- dbi:SQLite:dbname=myapp.db
List of arguments to DBI->connect(). See DBI for more description.
This module emulates DBIx::Class's on_connect_do feature. connect_info can take a hash at the end.

Naoki Tomita <tomita@cpan.org>

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