add missing files to sybase branch
Rafael Kitover [Wed, 3 Jun 2009 16:25:36 +0000 (16:25 +0000)]
lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm [new file with mode: 0644]
lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm [new file with mode: 0644]

diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm b/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm
new file mode 100644 (file)
index 0000000..37609ee
--- /dev/null
@@ -0,0 +1,20 @@
+package # hide from PAUSE
+    DBIx::Class::Storage::DBI::Sybase::DateTime;
+
+use strict;
+use warnings;
+use DateTime::Format::Strptime;
+
+my $inflate_format = DateTime::Format::Strptime->new(
+    pattern => '%Y-%m-%dT%H:%M:%S.%3NZ'
+);
+
+my $deflate_format = DateTime::Format::Strptime->new(
+    pattern => '%m/%d/%Y %H:%M:%S.%3N'
+);
+
+sub parse_datetime  { shift; $inflate_format->parse_datetime(@_) }
+
+sub format_datetime { shift; $deflate_format->format_datetime(@_) }
+
+1;
index 922ef47..35171e2 100644 (file)
@@ -4,8 +4,9 @@ use strict;
 use warnings;
 
 use base qw/
-  DBIx::Class::Storage::DBI::NoBindVars
   DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server
+  DBIx::Class::Storage::DBI::Sybase
+  DBIx::Class::Storage::DBI::NoBindVars
 /;
 
 1;
@@ -17,10 +18,7 @@ DBD::Sybase
 
 =head1 SYNOPSIS
 
-This subclass supports MSSQL connected via L<DBD::Sybase>.
-
-  $schema->storage_type('::DBI::Sybase::Microsoft_SQL_Server');
-  $schema->connect_info('dbi:Sybase:....', ...);
+This subclass supports MSSQL server connections via L<DBD::Sybase>.
 
 =head1 CAVEATS
 
diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
new file mode 100644 (file)
index 0000000..72a7372
--- /dev/null
@@ -0,0 +1,9 @@
+package # hide from PAUSE
+    DBIx::Class::Storage::DBI::Sybase::NoBindVars;
+
+use base qw/
+  DBIx::Class::Storage::DBI::NoBindVars
+  DBIx::Class::Storage::DBI::Sybase
+/;
+
+1;