With time couple DBIHacks methods became single-callsite only
[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
a2f22854 37sub next {
38 my $self = shift;
726c8f65 39
a2f22854 40 my @row = $self->next::method(@_);
726c8f65 41
a2f22854 42 _normalize_guids(
43 $self->args->[1],
44 $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]),
45 \@row,
46 $self->storage
47 );
726c8f65 48
49 return @row;
50}
51
a2f22854 52sub all {
53 my $self = shift;
726c8f65 54
a2f22854 55 my @rows = $self->next::method(@_);
726c8f65 56
a2f22854 57 _normalize_guids(
58 $self->args->[1],
59 $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]),
60 $_,
61 $self->storage
62 ) for @rows;
726c8f65 63
64 return @rows;
65}
66
a2bd3796 67=head1 FURTHER QUESTIONS?
726c8f65 68
a2bd3796 69Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
726c8f65 70
a2bd3796 71=head1 COPYRIGHT AND LICENSE
726c8f65 72
a2bd3796 73This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
74by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
75redistribute it and/or modify it under the same terms as the
76L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
726c8f65 77
78=cut
79
a2bd3796 801;
81
726c8f65 82# vim:sts=2 sw=2: