The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

use strict;
use Carp qw/confess/;
use Importer Importer => 'import';
our @EXPORT = qw/DTF/;
my $DTF;
sub DTF {
return $DTF if $DTF;
confess "You must first load a Test2::Harness::UI::Schema::NAME module"
unless $Test2::Harness::UI::Schema::LOADED;
if ($Test2::Harness::UI::Schema::LOADED =~ m/postgresql/i) {
return $DTF = 'DateTime::Format::Pg';
}
if ($Test2::Harness::UI::Schema::LOADED =~ m/mysql/i) {
return $DTF = 'DateTime::Format::MySQL';
}
die "Not sure what DateTime::Formatter to use";
}
1;