NAME
DBIx::Skinny::InflateColumn::DateTime - DateTime inflate/deflate and auto insert update time for DBIx::Skinny
SYNOPSIS
Use this module in your schema.
package Your::DB::Schema;
use DBIx::Skinny::Schema;
use DBIx::Skinny::InflateColumn::DateTime;
install_table table1 => {
pk 'id';
columns qw/id name created_at updated_at/;
};
install_table table2 => {
pk 'id';
columns qw/id name booked_on created_on updated_on/;
};
In your app.
my $row = Your::DB->single('table1', { id => 1 });
print $row->created_at->ymd; # created_at is DateTime object
DESCRIPTION
DBIx::Skinny::InflateColumn::DateTime provides inflate/deflate settings for *_at/*_on columns.
It also set trigger for pre_insert and pre_update.
Its concept refer to DBIx::Class::InflateColumn::DateTime, and some factor from DBIx::Class::InflateColumn::DateTime::Auto (http://blog.hide-k.net/archives/2006/08/dbixclassauto_i.php).
INFLATE/DEFLATE
This module installs inflate rule for /_(at|on)$/ columns.
That columns will be inflated as DateTime objects.
TRIGGERS
pre_insert
Set current time stamp for created_at, created_on, updated_at and updated_on if column exists.
pre_update
Set current time stamp for updated_at and updated_on if column exists.
Row object's columns will be updated as well.
AUTHOR
Ryo Miyake <ryo.studiom {at} gmail.com>
SEE ALSO
DBIx::Skinny, DBIx::Class::InflateColumn::DateTime
http://blog.hide-k.net/archives/2006/08/dbixclassauto_i.php
AUTHOR
Ryo Miyake <ryo.studiom __at__ gmail.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.