my $schema = DBICTest->init_schema();
-plan tests => 53;
+plan tests => 57;
SKIP: {
eval { require DateTime::Format::MySQL };
my $starts = $event->starts_at;
is("$starts", '2006-04-25T22:24:33', 'Correct date/time');
+TODO: {
+ local $TODO = "We can't do this yet before 0.09" if DBIx::Class->VERSION < 0.09;
+
+ ok(my $row =
+ $schema->resultset('Event')->search({ starts_at => $starts })->single);
+ is(eval { $row->id }, 1, 'DT in search');
+
+ ok($row =
+ $schema->resultset('Event')->search({ starts_at => { '>=' => $starts } })->single);
+ is(eval { $row->id }, 1, 'DT in search with condition');
+}
+
# create using DateTime
my $created = $schema->resultset('Event')->create({
starts_at => DateTime->new(year=>2006, month=>6, day=>18),
} # Skip if no MySQL DT::Formatter
SKIP: {
+ eval { require DateTime::Format::Pg };
+ skip ('Need DateTime::Format::Pg for timestamp inflation tests', 3) if $@;
- skip "ENV{DBIC_FLOATING_TZ_OK} was set, skipping", 3 unless eval { require DateTime::Format::Pg; 1};
my $event = $schema->resultset("EventTZPg")->find(1);
$event->update({created_on => '2009-01-15 17:00:00+00'});
$event->discard_changes;