+sub connect {
+ my ($self, @args) = @_;
+
+ my $dbh = $self->_connect(@args);
+ return undef if !$dbh;
+
+ my $initial_sql = $self->get_initial_sql;
+ $dbh->do($initial_sql) if $initial_sql;
+
+ return $dbh;
+}
+
+sub get_datestyle {
+ my ($self, $dateformat) = @_;
+ return $dateformat_to_datestyle{ $dateformat || $::myconfig{dateformat} // '' };
+}
+
+sub get_initial_sql {
+ my ($self) = @_;
+
+ return undef if !%::myconfig || !$::myconfig{dateformat};
+
+ my $datestyle = $self->get_datestyle;
+ return $datestyle ? qq|SET DateStyle to '${datestyle}'| : '';
+}
+