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'; |
616ca57f |
7 | |
2edf3352 |
8 | use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids'; |
616ca57f |
9 | use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; |
2edf3352 |
10 | use namespace::clean; |
726c8f65 |
11 | |
12 | =head1 NAME |
13 | |
14 | DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor - GUID Support for MS Access over |
15 | ADO |
16 | |
17 | =head1 DESCRIPTION |
18 | |
19 | This class is for normalizing GUIDs retrieved from Microsoft Access over ADO. |
20 | |
21 | You probably don't want to be here, see |
22 | L<DBIx::Class::Storage::DBI::ACCESS> for information on the Microsoft |
23 | Access driver. |
24 | |
25 | Unfortunately when using L<DBD::ADO>, GUIDs come back wrapped in braces, the |
26 | purpose of this class is to remove them. |
27 | L<DBIx::Class::Storage::DBI::ADO::MS_Jet> sets |
28 | L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by default. |
29 | It is overridable via your |
30 | L<connect_info|DBIx::Class::Storage::DBI/connect_info>. |
31 | |
32 | You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose |
33 | the GUID normalizing functionality, |
34 | L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data |
35 | for the inner cursor class. |
36 | |
37 | =cut |
38 | |
a2f22854 |
39 | sub 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 |
54 | sub 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 |
71 | Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. |
726c8f65 |
72 | |
a2bd3796 |
73 | =head1 COPYRIGHT AND LICENSE |
726c8f65 |
74 | |
a2bd3796 |
75 | This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> |
76 | by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can |
77 | redistribute it and/or modify it under the same terms as the |
78 | L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. |
726c8f65 |
79 | |
80 | =cut |
81 | |
a2bd3796 |
82 | 1; |
83 | |
726c8f65 |
84 | # vim:sts=2 sw=2: |