1 package DBIx::Class::Storage::DBI::SQLAnywhere::Cursor;
5 use base 'DBIx::Class::Storage::DBI::Cursor';
10 DBIx::Class::Storage::DBI::SQLAnywhere::Cursor - GUID Support for SQL Anywhere
11 over L<DBD::SQLAnywhere>
15 This class is for normalizing GUIDs retrieved from SQL Anywhere via
18 You probably don't want to be here, see
19 L<DBIx::Class::Storage::DBI::SQLAnywhere> for information on the SQL Anywhere
22 Unfortunately when using L<DBD::SQLAnywhere>, GUIDs come back in binary, the
23 purpose of this class is to transform them to text.
24 L<DBIx::Class::Storage::DBI::SQLAnywhere> sets
25 L<cursor_class|DBIx::Class::Storage::DBI/cursor_class> to this class by default.
26 It is overridable via your
27 L<connect_info|DBIx::Class::Storage::DBI/connect_info>.
29 You can use L<DBIx::Class::Cursor::Cached> safely with this class and not lose
30 the GUID normalizing functionality,
31 L<::Cursor::Cached|DBIx::Class::Cursor::Cached> uses the underlying class data
32 for the inner cursor class.
36 my $unpack_guids = sub {
37 my ($select, $col_infos, $data, $storage) = @_;
39 for my $select_idx (0..$#$select) {
41 defined $data->[$select_idx]
43 length($data->[$select_idx]) == 16
46 my $selected = $select->[$select_idx];
48 my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
51 $data->[$select_idx] = $storage->_uuid_to_str($data->[$select_idx])
52 if $storage->_is_guid_type($data_type);
60 my @row = $self->next::method(@_);
64 $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]),
75 my @rows = $self->next::method(@_);
79 $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]),
88 =head1 FURTHER QUESTIONS?
90 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
92 =head1 COPYRIGHT AND LICENSE
94 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
95 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
96 redistribute it and/or modify it under the same terms as the
97 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.