1 package DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor;
5 use base 'DBIx::Class::Storage::DBI::Cursor';
7 use DBIx::Class::Storage::DBI::ADO::CursorUtils qw/_normalize_guids _strip_trailing_binary_nulls/;
12 DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor - Remove trailing
13 NULLs in binary data and normalize GUIDs for MSSQL over ADO
17 This class is for removing trailing C<NULL>s from binary data and removing braces
18 from GUIDs retrieved from Microsoft SQL Server over ADO.
20 You probably don't want to be here, see
21 L<DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server> for information on the
22 Microsoft SQL Server driver for ADO and L<DBIx::Class::Storage::DBI::MSSQL> for
23 the Microsoft SQL Server driver base class.
25 Unfortunately when using L<DBD::ADO>, binary data comes back padded with
26 trailing C<NULL>s and GUIDs come back wrapped in braces, the purpose of this
27 class is to remove the C<NULL>s and braces.
28 L<DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server> sets
29 L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by
30 default. It is overridable via your
31 L<connect_info|DBIx::Class::Storage::DBI/connect_info>.
33 You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose
34 the binary data normalizing functionality,
35 L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data
36 for the inner cursor class.
41 my ($storage, $dbh, $self) = @_;
43 my $next = $self->next::can;
45 my @row = $next->(@_);
47 my $col_infos = $storage->_resolve_column_info($self->args->[0]);
49 my $select = $self->args->[1];
51 _normalize_guids($select, $col_infos, \@row, $storage);
52 _strip_trailing_binary_nulls($select, $col_infos, \@row);
58 my ($storage, $dbh, $self) = @_;
60 my $next = $self->next::can;
62 my @rows = $next->(@_);
64 my $col_infos = $storage->_resolve_column_info($self->args->[0]);
66 my $select = $self->args->[1];
69 _normalize_guids($select, $col_infos, $_, $storage);
70 _strip_trailing_binary_nulls($select, $col_infos, $_);
80 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
84 You may distribute this code under the same terms as Perl itself.