GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Skinny::InflateColumn::DateTime::Auto(3) User Contributed Perl Documentation DBIx::Skinny::InflateColumn::DateTime::Auto(3)

DBIx::Skinny::InflateColumn::DateTime::Auto - DateTime inflate/deflate and auto insert update time for DBIx::Skinny

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

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).

This module installs inflate rule for /_(at|on)$/ columns.

That columns will be inflated as DateTime objects.

default time_zone is 'local'.

set this option if you decide other time_zone.

Example:

  use DBIx::Skinny::InflateColumn::DateTime (time_zone => DateTime::TimeZone->new(name => 'Asia/Tokyo'));

default rules is [qr/^.+_at$/, qr/^.+_on$/].

set this option if you decide other rules.

Example:

  use DBIx::Skinny::InflateColumn::DateTime (rules => [qr/^created$/, qr/^updated$/]);

default rules is [qr/^created_at$/, qr/^created_on$/, qr/^updated_at$/, qr/^updated_on$/].

set this option if you decide other rules.

Example:

  use DBIx::Skinny::InflateColumn::DateTime (auto_insert_rules => [qr/^created$/, qr/^updated$/]);

default rules is [qr/^updated_at$/, qr/^updated_on$/].

set this option if you decide other rules.

Example:

  use DBIx::Skinny::InflateColumn::DateTime (auto_insert_rules => [qr/^updated$/]);

Set current time stamp if column match auto_insert_rules and exists.

Set current time stamp if column match auto_update_rules and exists.

Row object's columns will be updated as well.

Ryo Miyake <ryo.studiom {at} gmail.com>

DBIx::Skinny, DBIx::Class::InflateColumn::DateTime

http://blog.hide-k.net/archives/2006/08/dbixclassauto_i.php

Ryo Miyake "<ryo.studiom __at__ gmail.com>"

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2010-06-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.