File: MyFoo.pm

package info (click to toggle)
libclass-dbi-perl 0.96-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 388 kB
  • ctags: 229
  • sloc: perl: 1,933; makefile: 43
file content (27 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package MyFoo;

BEGIN { unshift @INC, './t/testlib'; }
use base 'MyBase';

use strict;

__PACKAGE__->set_table();
__PACKAGE__->columns(All => qw/myid name val tdate/);
__PACKAGE__->has_a(
	tdate   => 'Date::Simple',
	inflate => sub { Date::Simple->new(shift) },
	deflate => 'format',
);
__PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)");

sub create_sql {
	return qq{
    myid mediumint not null auto_increment primary key,
    name varchar(50) not null default '',
    val  char(1) default 'A',
    tdate date not null
  };
}

1;