Abraxxa-proof the distbuild (disallow `make manifest dist`)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / ADO / MS_Jet / Cursor.pm
1 package DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor;
2
3 use strict;
4 use warnings;
5 use base 'DBIx::Class::Storage::DBI::Cursor';
6 use mro 'c3';
7 use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids';
8 use namespace::clean;
9
10 =head1 NAME
11
12 DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor - GUID Support for MS Access over
13 ADO
14
15 =head1 DESCRIPTION
16
17 This class is for normalizing GUIDs retrieved from Microsoft Access over ADO.
18
19 You probably don't want to be here, see
20 L<DBIx::Class::Storage::DBI::ACCESS> for information on the Microsoft
21 Access driver.
22
23 Unfortunately when using L<DBD::ADO>, GUIDs come back wrapped in braces, the
24 purpose of this class is to remove them.
25 L<DBIx::Class::Storage::DBI::ADO::MS_Jet> sets
26 L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by default.
27 It is overridable via your
28 L<connect_info|DBIx::Class::Storage::DBI/connect_info>.
29
30 You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose
31 the GUID normalizing functionality,
32 L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data
33 for the inner cursor class.
34
35 =cut
36
37 sub _dbh_next {
38   my ($storage, $dbh, $self) = @_;
39
40   my $next = $self->next::can;
41
42   my @row = $next->(@_);
43
44   my $col_infos = $storage->_resolve_column_info($self->args->[0]);
45
46   my $select = $self->args->[1];
47
48   _normalize_guids($select, $col_infos, \@row, $storage);
49
50   return @row;
51 }
52
53 sub _dbh_all {
54   my ($storage, $dbh, $self) = @_;
55
56   my $next = $self->next::can;
57
58   my @rows = $next->(@_);
59
60   my $col_infos = $storage->_resolve_column_info($self->args->[0]);
61
62   my $select = $self->args->[1];
63
64   _normalize_guids($select, $col_infos, $_, $storage) for @rows;
65
66   return @rows;
67 }
68
69 1;
70
71 =head1 AUTHOR
72
73 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
74
75 =head1 LICENSE
76
77 You may distribute this code under the same terms as Perl itself.
78
79 =cut
80
81 # vim:sts=2 sw=2: