X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC%2FMicrosoft_SQL_Server.pm;h=e65654895cb1336f574b69cd96ab34d47ac71063;hb=6a52811b252a05921ad09ea6db7923383f880ba5;hp=5c03762ab8a0754bafe72993b7fcb303813ab2fa;hpb=6f96f99f2a205c59cd53628a8d2b19f8a76bd7ab;p=dbsrgits%2FDBIx-Class-Historic.git 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<< >>