Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more
|
our $VERSION = '0.000004' ;
requires 'connection' ;
requires 'transactions' ;
alias 'txn' => 'transaction' ;
sub txn { my $t = $_ [0]->transactions; return undef unless $t && @$t ; return $t ->[-1] }
sub txns { shift ->transactions( @_ ) }
alias in_txn => 'in_transaction' ;
sub in_txn {
my $self = shift ;
my $txns = $self ->transactions;
if ( my $cnt = @{ $txns }) {
return $cnt ;
}
return -1 if $self ->connection->in_external_transaction;
return 0;
}
1;
|