1 package DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor;
5 use base 'DBIx::Class::Storage::DBI::Cursor';
10 DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor - GUID Support for MS Access over
15 This class is for normalizing GUIDs retrieved from Microsoft Access over ADO.
17 You probably don't want to be here, see
18 L<DBIx::Class::Storage::DBI::ACCESS> for information on the Microsoft
21 Unfortunately when using L<DBD::ADO>, GUIDs come back wrapped in braces, the
22 purpose of this class is to remove them.
23 L<DBIx::Class::Storage::DBI::ADO::MS_Jet> sets
24 L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by default.
25 It is overridable via your
26 L<connect_info|DBIx::Class::Storage::DBI/connect_info>.
28 You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose
29 the GUID normalizing functionality,
30 L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data
31 for the inner cursor class.
36 my ($storage, $dbh, $self) = @_;
38 my $next = $self->next::can;
40 my @row = $next->(@_);
42 my $col_info = $storage->_resolve_column_info($self->args->[0]);
44 my $select = $self->args->[1];
46 for my $select_idx (0..$#$select) {
47 my $selected = $select->[$select_idx];
49 next if ref $selected;
51 my $data_type = $col_info->{$selected}{data_type};
53 if ($storage->_is_guid_type($data_type)) {
54 my $returned = $row[$select_idx];
56 $row[$select_idx] = substr($returned, 1, 36)
57 if substr($returned, 0, 1) eq '{';
65 my ($storage, $dbh, $self) = @_;
67 my $next = $self->next::can;
69 my @rows = $next->(@_);
71 my $col_info = $storage->_resolve_column_info($self->args->[0]);
73 my $select = $self->args->[1];
76 for my $select_idx (0..$#$select) {
77 my $selected = $select->[$select_idx];
79 next if ref $selected;
81 my $data_type = $col_info->{$selected}{data_type};
83 if ($storage->_is_guid_type($data_type)) {
84 my $returned = $row->[$select_idx];
86 $row->[$select_idx] = substr($returned, 1, 36)
87 if substr($returned, 0, 1) eq '{';
99 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
103 You may distribute this code under the same terms as Perl itself.