NAME
DBIx::Skinny::Schema - Schema DSL for DBIx::Skinny
SYNOPSIS
package Your::Model;
use DBIx::Skinny connect_info => +{
dsn => 'dbi:SQLite:',
username => '',
password => '',
};
1;
package Your::Model::Schema:
use DBIx::Skinny::Schema;
install_utf8_columns qw/name/; # for utf8 columns
# set user table schema settings
install_table user => schema {
pk 'id';
columns qw/id name created_at/;
trigger pre_insert => callback {
# hook
};
trigger pre_update => callback {
# hook
};
row_class 'Your::Model::Row::User';
};
install_inflate_rule '^name$' => callback {
inflate {
my $value = shift;
# inflate hook
};
deflate {
my $value = shift;
# deflate hook
};
};
1;