| 1 | package DBIO::MySQL::Storage::MariaDB::Async; | ||
| 2 | # ABSTRACT: future_io async adapter for MariaDB-DSN connections (DBD::MariaDB binding) | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use base 'DBIO::MySQL::Storage::Async'; | ||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | sub _async_prepare_attrs { { mariadb_async => 1 } } | ||
| 11 | |||
| 12 | |||
| 13 | sub _conn_socket_fd { $_[1]->mariadb_sockfd } | ||
| 14 | |||
| 15 | |||
| 16 | sub _async_ready { $_[1]->mariadb_async_ready } | ||
| 17 | |||
| 18 | |||
| 19 | sub _async_result { $_[1]->mariadb_async_result } | ||
| 20 | |||
| 21 | |||
| 22 | sub _async_insertid { $_[1]->{mariadb_insertid} } | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ | ||
| 27 | |||
| 28 | =pod | ||
| 29 | |||
| 30 | =encoding UTF-8 | ||
| 31 | |||
| 32 | =head1 NAME | ||
| 33 | |||
| 34 | DBIO::MySQL::Storage::MariaDB::Async - future_io async adapter for MariaDB-DSN connections (DBD::MariaDB binding) | ||
| 35 | |||
| 36 | =head1 VERSION | ||
| 37 | |||
| 38 | version 0.900001 | ||
| 39 | |||
| 40 | =head1 DESCRIPTION | ||
| 41 | |||
| 42 | The C<future_io> transport adapter resolved by convention for a C<dbi:MariaDB:> | ||
| 43 | connection. DBIO reblesses such a connection into L<DBIO::MySQL::Storage::MariaDB> | ||
| 44 | (the MariaDB driver storage subclass), so the core future_io resolver derives | ||
| 45 | C<ref($storage) . '::Async'> == C<DBIO::MySQL::Storage::MariaDB::Async> (ADR 0030 | ||
| 46 | refinement, karr #65). | ||
| 47 | |||
| 48 | It reuses all the shared transport control flow from | ||
| 49 | L<DBIO::MySQL::Storage::Async> and overrides B<only> the five DBD-specific async | ||
| 50 | primitives, swapping DBD::mysql's binding for L<DBD::MariaDB>'s C<mariadb_*> one. | ||
| 51 | This exactly mirrors the sync split, where L<DBIO::MySQL::Storage::MariaDB> | ||
| 52 | overrides L<DBIO::MySQL::Storage> to read C<mariadb_insertid>: a C<dbi:MariaDB:> | ||
| 53 | future_io connection drives DBD::MariaDB's C<mariadb_async> binding, while a | ||
| 54 | C<dbi:mysql:> one drives DBD::mysql's C<async> binding, so whichever DBD the user | ||
| 55 | named in the DSN is the one used for async. | ||
| 56 | |||
| 57 | =head1 METHODS | ||
| 58 | |||
| 59 | =head2 _async_prepare_attrs | ||
| 60 | |||
| 61 | DBD::MariaDB arms an async query with C<< { mariadb_async => 1 } >>. | ||
| 62 | |||
| 63 | =head2 _conn_socket_fd | ||
| 64 | |||
| 65 | DBD::MariaDB exposes the connection socket fd as C<< $dbh->mariadb_sockfd >>. | ||
| 66 | |||
| 67 | =head2 _async_ready | ||
| 68 | |||
| 69 | DBD::MariaDB C<< $sth->mariadb_async_ready >>. | ||
| 70 | |||
| 71 | =head2 _async_result | ||
| 72 | |||
| 73 | DBD::MariaDB C<< $sth->mariadb_async_result >>. | ||
| 74 | |||
| 75 | =head2 _async_insertid | ||
| 76 | |||
| 77 | DBD::MariaDB per-statement C<< $sth->{mariadb_insertid} >>. | ||
| 78 | |||
| 79 | =head1 AUTHOR | ||
| 80 | |||
| 81 | DBIO & DBIx::Class Authors | ||
| 82 | |||
| 83 | =head1 COPYRIGHT AND LICENSE | ||
| 84 | |||
| 85 | Copyright (C) 2026 DBIO Authors | ||
| 86 | Portions Copyright (C) 2005-2025 DBIx::Class Authors | ||
| 87 | Based on DBIx::Class, heavily modified. | ||
| 88 | |||
| 89 | This is free software; you can redistribute it and/or modify it under | ||
| 90 | the same terms as the Perl 5 programming language system itself. | ||
| 91 | |||
| 92 | =cut |