[Bast-commits] r6494 - in DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI: . Sybase

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Thu Jun 4 02:52:31 GMT 2009


Author: caelum
Date: 2009-06-04 02:52:31 +0000 (Thu, 04 Jun 2009)
New Revision: 6494

Modified:
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
Log:
update Sybase docs

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm	2009-06-04 00:20:37 UTC (rev 6493)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm	2009-06-04 02:52:31 UTC (rev 6494)
@@ -6,11 +6,11 @@
 use DateTime::Format::Strptime;
 
 my $inflate_format = DateTime::Format::Strptime->new(
-    pattern => '%Y-%m-%dT%H:%M:%S.%3NZ'
+  pattern => '%Y-%m-%dT%H:%M:%S.%3NZ'
 );
 
 my $deflate_format = DateTime::Format::Strptime->new(
-    pattern => '%m/%d/%Y %H:%M:%S.%3N'
+  pattern => '%m/%d/%Y %H:%M:%S.%3N'
 );
 
 sub parse_datetime  { shift; $inflate_format->parse_datetime(@_) }
@@ -18,3 +18,23 @@
 sub format_datetime { shift; $deflate_format->format_datetime(@_) }
 
 1;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::Sybase::DateTime - DateTime inflation/deflation
+support for Sybase in L<DBIx::Class>.
+
+=head1 DESCRIPTION
+
+This needs to become L<DateTime::Format::Sybase>.
+
+=head1 AUTHORS
+
+See L<DBIx::Class/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
+# vim:sts=2 sw=2:

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm	2009-06-04 00:20:37 UTC (rev 6493)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm	2009-06-04 02:52:31 UTC (rev 6494)
@@ -28,6 +28,9 @@
 More importantly this means that caching of prepared statements is explicitly
 disabled, as the interpolation renders it useless.
 
+The actual driver code for MSSQL is in
+L<DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server>.
+
 =head1 AUTHORS
 
 Brandon L Black <blblack at gmail.com>

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-06-04 00:20:37 UTC (rev 6493)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-06-04 02:52:31 UTC (rev 6494)
@@ -14,3 +14,45 @@
 }
 
 1;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::Sybase::NoBindVars - Storage::DBI subclass for Sybase
+without placeholder support
+
+=head1 DESCRIPTION
+
+If you're using this driver than your version of Sybase does not support
+placeholders. You can check with:
+
+  $dbh->{syb_dynamic_supported}
+
+You can also enable this driver explicitly using:
+
+  my $schema = SchemaClass->clone;
+  $schema->storage_type('::DBI::Sybase::NoBindVars');
+  $schema->connect($dsn, $user, $pass, \%opts);
+
+See the discussion in L<< DBD::Sybase/Using ? Placeholders & bind parameters to
+$sth->execute >> for details on the pros and cons of using placeholders.
+
+One advantage of not using placeholders is that C<select @@identity> will work
+for obtainging the last insert id of an C<IDENTITY> column, instead of having to
+do C<select max(col)> as the base Sybase driver does.
+
+When using this driver, bind variables will be interpolated (properly quoted of
+course) into the SQL query itself, without using placeholders.
+
+The caching of prepared statements is also explicitly disabled, as the
+interpolation renders it useless.
+
+=head1 AUTHORS
+
+See L<DBIx::Class/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
+# vim:sts=2 sw=2:

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-06-04 00:20:37 UTC (rev 6493)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-06-04 02:52:31 UTC (rev 6494)
@@ -69,44 +69,34 @@
 
 =head1 SYNOPSIS
 
-This subclass supports L<DBD::Sybase> for real Sybase databases.  If
-you are using an MSSQL database via L<DBD::Sybase>, see
-L<DBIx::Class::Storage::DBI::Sybase::MSSQL>.
+This subclass supports L<DBD::Sybase> for real Sybase databases.  If you are
+using an MSSQL database via L<DBD::Sybase>, your storage will be reblessed to
+L<DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server>.
 
-=head1 CAVEATS
+=head1 DESCRIPTION
 
-If your version of Sybase does not support placeholders, then this storage
-driver uses L<DBIx::Class::Storage::DBI::NoBindVars> as a base,
+If your version of Sybase does not support placeholders, then your storage
+will be reblessed to L<DBIx::Class::Storage::DBI::Sybase::NoBindVars>. You can
+also enable that driver explicitly, see the documentation for more details.
 
-In which case, bind variables will be interpolated (properly quoted of course)
-into the SQL query itself, without using bind placeholders.
+With this driver there is unfortunately no way to get the C<last_insert_id>
+without doing a C<select max(col)>.
 
-More importantly this means that caching of prepared statements is explicitly
-disabled, as the interpolation renders it useless.
-
-If your version of Sybase B<DOES> support placeholders (check
-C<<$dbh->{syb_dynamic_supported}>> then unfortunately there's no way to get the
-C<last_insert_id> without doing a C<select max(col)>.
-
 But your queries will be cached.
 
 =head1 DATES
 
 On connection C<syb_date_fmt> is set to C<ISO_strict>, e.g.:
 C<2004-08-21T14:36:48.080Z> and C<dateformat> is set to C<mdy>, e.g.:
-C<08/13/1979>.
+C<08/13/1979 18:08:55.080>.
 
 You will need the L<DateTime::Format::Strptime> module if you are going to use
 L<DBIx::Class::InflateColumn::DateTime>.
 
 =head1 AUTHORS
 
-Brandon L Black <blblack at gmail.com>
+See L<DBIx::Class/CONTRIBUTORS>.
 
-Justin Hunter <justin.d.hunter at gmail.com>
-
-Rafael Kitover <rkitover at cpan.org>
-
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.




More information about the Bast-commits mailing list