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