DBIx-QuickORM

 view release on metacpan or  search on metacpan

lib/DBIx/QuickORM/Manual/Async.pm  view on Meta::CPAN


C<all()>, C<count()>, C<iterate()>, and C<first()>/C<one()> in C<data_only>
mode are B<not> available on an async handle - C<all()> in particular would
have to block, defeating the purpose. Use C<iterator()> and its C<ready()>
method instead.

=head2 Single-row async results

C<one()> and C<first()> on an async handle return a
L<DBIx::QuickORM::Row::Async> placeholder rather than a real row. It is a
transparent proxy: it is true while pending, and the first time you call a real
method on it (or check C<isa>/C<can>/C<DOES>) it materializes the row from the
arrived results and swaps itself out in place, so you transparently end up
holding the real row object. If the query returned no data or was cancelled the
proxy becomes invalid - it is false in boolean context and method calls croak.

    my $row = $h->async->one;    # placeholder, true while pending
    print $row->field('name');   # blocks if needed, then forwards to the real row

Inserts behave the same way: an C<insert> on an async handle returns a
placeholder row that materializes once the insert result arrives.

=head1 CANCELLATION

lib/DBIx/QuickORM/Manual/Types.pm  view on Meta::CPAN

=head1 DESCRIPTION

A B<type> in L<DBIx::QuickORM> is a class that knows how to convert a column
value between the form stored in the database and a richer Perl form. Going
from the database to Perl is I<inflation>; going from Perl back to the database
is I<deflation>.

The database stores a JSON document as a string; you usually want a Perl hash
or array. A UUID is bytes or text in a column; you usually want the canonical
hyphenated string. A type bridges that gap so your row accessors hand back the
inflated value and your writes are deflated transparently.

This document covers the built-in JSON and UUID types, how to apply a type to a
column, how C<autotype> applies types automatically, and how to write your own
type class.

This is part of the L<DBIx::QuickORM::Manual>.

=head1 HOW A TYPE MAPS DATABASE VALUE TO PERL VALUE

A type class consumes L<DBIx::QuickORM::Role::Type> and implements a small set

lib/DBIx/QuickORM/Row/Async.pm  view on Meta::CPAN

=pod

=encoding UTF-8

=head1 NAME

DBIx::QuickORM::Row::Async - Placeholder that swaps itself for a real row once async results arrive.

=head1 DESCRIPTION

A transparent proxy returned for an asynchronous single-row query. It holds an
async statement handle and, once results are ready, materializes the real row
and swaps itself out in place via the C<$_[0]> alias, so callers transparently
end up holding the real row object. Until then it forwards method calls,
C<isa>, C<can>, and C<DOES> to the eventual row's class. If the query returns
no data or is cancelled the proxy becomes invalid: boolean context is false
and method calls croak.

Construction requires an C<async> handle implementing
L<DBIx::QuickORM::Role::Async>. Optional C<auto_refresh> refreshes the row once
materialized; C<state_method> (default C<state_select_row>) and C<state_args>
control how the connection builds the row.

worktrees/audit-fixes-master/lib/DBIx/QuickORM/Manual/Async.pm  view on Meta::CPAN


C<all()>, C<count()>, C<iterate()>, and C<first()>/C<one()> in C<data_only>
mode are B<not> available on an async handle - C<all()> in particular would
have to block, defeating the purpose. Use C<iterator()> and its C<ready()>
method instead.

=head2 Single-row async results

C<one()> and C<first()> on an async handle return a
L<DBIx::QuickORM::Row::Async> placeholder rather than a real row. It is a
transparent proxy: it is true while pending, and the first time you call a real
method on it (or check C<isa>/C<can>/C<DOES>) it materializes the row from the
arrived results and swaps itself out in place, so you transparently end up
holding the real row object. If the query returned no data or was cancelled the
proxy becomes invalid - it is false in boolean context and method calls croak.

    my $row = $h->async->one;    # placeholder, true while pending
    print $row->field('name');   # blocks if needed, then forwards to the real row

Inserts behave the same way: an C<insert> on an async handle returns a
placeholder row that materializes once the insert result arrives.

=head1 CANCELLATION

worktrees/audit-fixes-master/lib/DBIx/QuickORM/Manual/Types.pm  view on Meta::CPAN

=head1 DESCRIPTION

A B<type> in L<DBIx::QuickORM> is a class that knows how to convert a column
value between the form stored in the database and a richer Perl form. Going
from the database to Perl is I<inflation>; going from Perl back to the database
is I<deflation>.

The database stores a JSON document as a string; you usually want a Perl hash
or array. A UUID is bytes or text in a column; you usually want the canonical
hyphenated string. A type bridges that gap so your row accessors hand back the
inflated value and your writes are deflated transparently.

This document covers the built-in JSON and UUID types, how to apply a type to a
column, how C<autotype> applies types automatically, and how to write your own
type class.

This is part of the L<DBIx::QuickORM::Manual>.

=head1 HOW A TYPE MAPS DATABASE VALUE TO PERL VALUE

A type class consumes L<DBIx::QuickORM::Role::Type> and implements a small set

worktrees/audit-fixes-master/lib/DBIx/QuickORM/Row/Async.pm  view on Meta::CPAN

=pod

=encoding UTF-8

=head1 NAME

DBIx::QuickORM::Row::Async - Placeholder that swaps itself for a real row once async results arrive.

=head1 DESCRIPTION

A transparent proxy returned for an asynchronous single-row query. It holds an
async statement handle and, once results are ready, materializes the real row
and swaps itself out in place via the C<$_[0]> alias, so callers transparently
end up holding the real row object. Until then it forwards method calls,
C<isa>, C<can>, and C<DOES> to the eventual row's class. If the query returns
no data or is cancelled the proxy becomes invalid: boolean context is false
and method calls croak.

Construction requires an C<async> handle implementing
L<DBIx::QuickORM::Role::Async>. Optional C<auto_refresh> refreshes the row once
materialized; C<state_method> (default C<state_select_row>) and C<state_args>
control how the connection builds the row.

worktrees/dbic-compat-native-features/lib/DBIx/QuickORM/Manual/Async.pm  view on Meta::CPAN


C<all()>, C<count()>, C<iterate()>, and C<first()>/C<one()> in C<data_only>
mode are B<not> available on an async handle - C<all()> in particular would
have to block, defeating the purpose. Use C<iterator()> and its C<ready()>
method instead.

=head2 Single-row async results

C<one()> and C<first()> on an async handle return a
L<DBIx::QuickORM::Row::Async> placeholder rather than a real row. It is a
transparent proxy: it is true while pending, and the first time you call a real
method on it (or check C<isa>/C<can>/C<DOES>) it materializes the row from the
arrived results and swaps itself out in place, so you transparently end up
holding the real row object. If the query returned no data or was cancelled the
proxy becomes invalid - it is false in boolean context and method calls croak.

    my $row = $h->async->one;    # placeholder, true while pending
    print $row->field('name');   # blocks if needed, then forwards to the real row

Inserts behave the same way: an C<insert> on an async handle returns a
placeholder row that materializes once the insert result arrives.

=head1 CANCELLATION

worktrees/dbic-compat-native-features/lib/DBIx/QuickORM/Manual/Types.pm  view on Meta::CPAN

=head1 DESCRIPTION

A B<type> in L<DBIx::QuickORM> is a class that knows how to convert a column
value between the form stored in the database and a richer Perl form. Going
from the database to Perl is I<inflation>; going from Perl back to the database
is I<deflation>.

The database stores a JSON document as a string; you usually want a Perl hash
or array. A UUID is bytes or text in a column; you usually want the canonical
hyphenated string. A type bridges that gap so your row accessors hand back the
inflated value and your writes are deflated transparently.

This document covers the built-in JSON and UUID types, how to apply a type to a
column, how C<autotype> applies types automatically, and how to write your own
type class.

This is part of the L<DBIx::QuickORM::Manual>.

=head1 HOW A TYPE MAPS DATABASE VALUE TO PERL VALUE

A type class consumes L<DBIx::QuickORM::Role::Type> and implements a small set

worktrees/dbic-compat-native-features/lib/DBIx/QuickORM/Row/Async.pm  view on Meta::CPAN

=pod

=encoding UTF-8

=head1 NAME

DBIx::QuickORM::Row::Async - Placeholder that swaps itself for a real row once async results arrive.

=head1 DESCRIPTION

A transparent proxy returned for an asynchronous single-row query. It holds an
async statement handle and, once results are ready, materializes the real row
and swaps itself out in place via the C<$_[0]> alias, so callers transparently
end up holding the real row object. Until then it forwards method calls,
C<isa>, C<can>, and C<DOES> to the eventual row's class. If the query returns
no data or is cancelled the proxy becomes invalid: boolean context is false
and method calls croak.

Construction requires an C<async> handle implementing
L<DBIx::QuickORM::Role::Async>. Optional C<auto_refresh> refreshes the row once
materialized; C<state_method> (default C<state_select_row>) and C<state_args>
control how the connection builds the row.



( run in 2.048 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )