Merge the relationship resolution rework
[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';
616ca57f 7
2edf3352 8use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids';
616ca57f 9use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info';
2edf3352 10use namespace::clean;
726c8f65 11
12=head1 NAME
13
14DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor - GUID Support for MS Access over
15ADO
16
17=head1 DESCRIPTION
18
19This class is for normalizing GUIDs retrieved from Microsoft Access over ADO.
20
21You probably don't want to be here, see
22L<DBIx::Class::Storage::DBI::ACCESS> for information on the Microsoft
23Access driver.
24
25Unfortunately when using L<DBD::ADO>, GUIDs come back wrapped in braces, the
26purpose of this class is to remove them.
27L<DBIx::Class::Storage::DBI::ADO::MS_Jet> sets
28L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by default.
29It is overridable via your
30L<connect_info|DBIx::Class::Storage::DBI/connect_info>.
31
32You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose
33the GUID normalizing functionality,
34L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data
35for the inner cursor class.
36
37=cut
38
a2f22854 39sub next {
40 my $self = shift;
726c8f65 41
a2f22854 42 my @row = $self->next::method(@_);
726c8f65 43
a2f22854 44 _normalize_guids(
45 $self->args->[1],
616ca57f 46 $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]),
a2f22854 47 \@row,
48 $self->storage
49 );
726c8f65 50
51 return @row;
52}
53
a2f22854 54sub all {
55 my $self = shift;
726c8f65 56
a2f22854 57 my @rows = $self->next::method(@_);
726c8f65 58
a2f22854 59 _normalize_guids(
60 $self->args->[1],
616ca57f 61 $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]),
a2f22854 62 $_,
63 $self->storage
64 ) for @rows;
726c8f65 65
66 return @rows;
67}
68
a2bd3796 69=head1 FURTHER QUESTIONS?
726c8f65 70
a2bd3796 71Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
726c8f65 72
a2bd3796 73=head1 COPYRIGHT AND LICENSE
726c8f65 74
a2bd3796 75This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
76by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
77redistribute it and/or modify it under the same terms as the
78L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
726c8f65 79
80=cut
81
a2bd3796 821;
83
726c8f65 84# vim:sts=2 sw=2: