[Bast-commits] r3965 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC

semifor at dev.catalyst.perl.org semifor at dev.catalyst.perl.org
Tue Jan 22 15:13:12 GMT 2008


Author: semifor
Date: 2008-01-22 15:13:11 +0000 (Tue, 22 Jan 2008)
New Revision: 3965

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm
Log:
Added build_datetime_parser method for MSSQL over ODBC.

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm	2008-01-22 04:31:46 UTC (rev 3964)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm	2008-01-22 15:13:11 UTC (rev 3965)
@@ -38,6 +38,14 @@
     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 @@
 
 =head2 sqlt_type
 
+=head2 build_datetime_parser
+
+The resulting parser handles the MSSQL C<DATETIME> type, but is almost
+certainly not sufficient for the other MSSQL 2008 date/time types.
+
 =head1 AUTHORS
 
 Marc Mims C<< <marc at questright.com> >>




More information about the Bast-commits mailing list