From: Marc Mims Date: Tue, 22 Jan 2008 15:13:11 +0000 (+0000) Subject: Added build_datetime_parser method for MSSQL over ODBC. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a52811b252a05921ad09ea6db7923383f880ba5;p=dbsrgits%2FDBIx-Class-Historic.git Added build_datetime_parser method for MSSQL over ODBC. --- diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm index 5c03762..e656548 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -38,6 +38,14 @@ sub _sql_maker_opts { return { limit_dialect => 'Top', %{$self->{_sql_maker_opts}||{}} }; } +sub build_datetime_parser { + my $self = shift; + my $type = "DateTime::Format::Strptime"; + eval "use ${type}"; + $self->throw_exception("Couldn't load ${type}: $@") if $@; + return $type->new( pattern => '%F %T' ); +} + 1; __END__ @@ -72,6 +80,11 @@ onto each INSERT to accommodate that requirement. =head2 sqlt_type +=head2 build_datetime_parser + +The resulting parser handles the MSSQL C type, but is almost +certainly not sufficient for the other MSSQL 2008 date/time types. + =head1 AUTHORS Marc Mims C<< >>