Commit | Line | Data |
2040ad73 |
1 | package # Hide from PAUSE |
2 | ImplicitInflate; |
3 | |
4 | # Test class for the testing of Implicit inflation |
5 | # in CDBI Classes using Compat layer |
6 | # See t/cdbi/70-implicit_inflate.t |
7 | |
8 | use strict; |
9 | use warnings; |
10 | |
11 | use base 'DBIC::Test::SQLite'; |
12 | |
13 | __PACKAGE__->set_table('Date'); |
14 | |
15 | __PACKAGE__->columns( Primary => 'id' ); |
16 | __PACKAGE__->columns( All => qw/ update_datetime text/); |
17 | |
18 | __PACKAGE__->has_a( |
19 | update_datetime => 'MyDateStamp', |
20 | ); |
21 | |
22 | sub create_sql { |
23 | # SQLite doesn't support Datetime datatypes. |
24 | return qq{ |
25 | id INTEGER PRIMARY KEY, |
26 | update_datetime TEXT, |
27 | text VARCHAR(20) |
28 | } |
29 | } |
30 | |
31 | { |
32 | package MyDateStamp; |
33 | |
34 | use DateTime::Format::SQLite; |
35 | |
36 | sub new { |
37 | my ($self, $value) = @_; |
38 | return DateTime::Format::SQLite->parse_datetime($value); |
39 | } |
40 | } |
41 | |
42 | 1; |