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=f263fb3ebdb7f99484fa0513bd269cc4b08e4f4f;hb=7f32c82b6791c30615bd6da46063e2a80be3ebc5;hp=2fde285e75d671bd77eccba1f20c5ab52f37acbd;hpb=2ad62d97476187e57d20ee49b39d7a7af864bb20;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 2fde285..f263fb3 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -4,9 +4,147 @@ use warnings; use base qw/DBIx::Class::Storage::DBI::MSSQL/; use mro 'c3'; - +use Carp::Clan qw/^DBIx::Class/; use List::Util(); +__PACKAGE__->mk_group_accessors(simple => qw/ + _identity _using_dynamic_cursors +/); + +=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, +including auto-increment primary keys and SQL::Abstract::Limit dialect. It +is loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it +detects a MSSQL back-end. + +=head1 IMPLEMENTATION NOTES + +Microsoft SQL Server supports three methods of retrieving the C +value for inserted row: C, C<@@IDENTITY>, and C. +C is used here because it is the safest. However, it must +be called is the same execute statement, not just the same connection. + +So, this implementation appends a C is used instead. + +=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. + +This will not work with CODE ref connect_info's and will do nothing if you set +C yourself. + +B this will break C, and C