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=bf01131c6a9a14590fc6420a63cf71b4687fb3e9;hb=1a58752c42ba9acf33e2943b678de4948cf3ee3f;hp=5c03762ab8a0754bafe72993b7fcb303813ab2fa;hpb=6f96f99f2a205c59cd53628a8d2b19f8a76bd7ab;p=dbsrgits%2FDBIx-Class.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..bf01131 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -2,82 +2,188 @@ package DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server; use strict; use warnings; -use base qw/DBIx::Class::Storage::DBI/; +use base qw/DBIx::Class::Storage::DBI::MSSQL/; +use mro 'c3'; -sub _prep_for_execute { - my $self = shift; - my ($op, $extra_bind, $ident, $args) = @_; +use List::Util(); +use Scalar::Util (); - my ($sql, $bind) = $self->SUPER::_prep_for_execute(@_); - $sql .= ';SELECT SCOPE_IDENTITY()' if $op eq 'insert'; +__PACKAGE__->mk_group_accessors(simple => qw/ + _using_dynamic_cursors +/); - return ($sql, $bind); -} +=head1 NAME + +DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server - Support specific +to Microsoft SQL Server over ODBC + +=head1 DESCRIPTION + +This class implements support specific to Microsoft SQL Server over ODBC. It is +loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it detects a +MSSQL back-end. + +Most of the functionality is provided from the superclass +L. + +=head1 MULTIPLE ACTIVE STATEMENTS + +The following options are alternative ways to enable concurrent executing +statement support. Each has its own advantages and drawbacks. + +=head2 connect_call_use_dynamic_cursors + +Use as: + + on_connect_call => 'use_dynamic_cursors' + +in your L as one way to enable multiple +concurrent statements. + +Will add C<< odbc_cursortype => 2 >> to your DBI connection attributes. See +L for more information. + +Alternatively, you can add it yourself and dynamic cursor support will be +automatically enabled. + +If you're using FreeTDS, C must be set to at least C<8.0>. + +This will not work with CODE ref connect_info's. + +B this will break C, and C