Commit | Line | Data |
726c8f65 |
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'; |
2edf3352 |
7 | use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids'; |
8 | use namespace::clean; |
726c8f65 |
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 | |
a2f22854 |
37 | sub 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 |
52 | sub 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 | |
67 | 1; |
68 | |
69 | =head1 AUTHOR |
70 | |
71 | See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>. |
72 | |
73 | =head1 LICENSE |
74 | |
75 | You may distribute this code under the same terms as Perl itself. |
76 | |
77 | =cut |
78 | |
79 | # vim:sts=2 sw=2: |