DBIO-PostgreSQL-Async

 view release on metacpan or  search on metacpan

lib/DBIO/PostgreSQL/Async/Storage.pm  view on Meta::CPAN

  return $self->_run_crud('select_single', $self->_pool_runner, @_);
}


sub insert_async {
  my $self = shift;
  return $self->_run_crud('insert', $self->_pool_runner, @_);
}


sub update_async {
  my $self = shift;
  return $self->_run_crud('update', $self->_pool_runner, @_);
}


sub delete_async {
  my $self = shift;
  return $self->_run_crud('delete', $self->_pool_runner, @_);
}

lib/DBIO/PostgreSQL/Async/Storage.pm  view on Meta::CPAN

sub select_single {
  my $self = shift;
  return $self->select_single_async(@_)->get;
}

sub insert {
  my $self = shift;
  return $self->insert_async(@_)->get;
}

sub update {
  my $self = shift;
  return $self->update_async(@_)->get;
}

sub delete {
  my $self = shift;
  return $self->delete_async(@_)->get;
}

sub txn_do {

lib/DBIO/PostgreSQL/Async/TransactionContext.pm  view on Meta::CPAN


# CRUD inside a transaction MUST run on the pinned connection that
# BEGIN/COMMIT ran on, not a fresh pooled one. Each method routes
# through the storage's shared CRUD builder with the pinned connection,
# so SQL generation (insert RETURNING, select_single first-row) is not
# duplicated. Forwarding to $storage->select_async etc. would acquire a
# separate pool connection and run the query OUTSIDE the transaction.
sub select_async        { my $self = shift; $self->{storage}->_run_crud_pinned('select',        $self->{pg}, @_) }
sub select_single_async { my $self = shift; $self->{storage}->_run_crud_pinned('select_single', $self->{pg}, @_) }
sub insert_async        { my $self = shift; $self->{storage}->_run_crud_pinned('insert',        $self->{pg}, @_) }
sub update_async        { my $self = shift; $self->{storage}->_run_crud_pinned('update',        $self->{pg}, @_) }
sub delete_async        { my $self = shift; $self->{storage}->_run_crud_pinned('delete',        $self->{pg}, @_) }
sub select             { my $self = shift; $self->select_async(@_)->get        }
sub select_single      { my $self = shift; $self->select_single_async(@_)->get }
sub insert             { my $self = shift; $self->insert_async(@_)->get        }
sub update             { my $self = shift; $self->update_async(@_)->get        }
sub delete             { my $self = shift; $self->delete_async(@_)->get        }
sub sql_maker          { my $self = shift; $self->{storage}->sql_maker(@_)          }
sub debug              { my $self = shift; $self->{storage}->debug(@_)              }

1;

__END__

=pod



( run in 1.442 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )