Mojo::Pg::Transaction(3pm)

Mojo::Pg::Transaction3pm

Transaction

Usage

  use Mojo::Pg::Transaction;
  my $tx = Mojo::Pg::Transaction->new(db => $db);
  $tx->commit;

Overview

Mojo::Pg::Transaction is a scope guard for DBD::Pg transactions used by Mojo::Pg::Database.

Attributes

Mojo::Pg::Transaction implements the following attributes.

db

  my $db = $tx->db;
  $tx    = $tx->db(Mojo::Pg::Database->new);

Mojo::Pg::Database object this transaction belongs to. Note that this attribute is weakened.

Methods

Mojo::Pg::Transaction inherits all methods from Mojo::Base and implements the following new ones.

commit

  $tx->commit;

Commit transaction.

new

  my $tx = Mojo::Pg::Transaction->new;
  my $tx = Mojo::Pg::Transaction->new(db => Mojo::Pg::Database->new);
  my $tx = Mojo::Pg::Transaction->new({db => Mojo::Pg::Database->new});

Construct a new Mojo::Pg::Transaction object.

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10
  3. 11
  4. 12–13

From libmojo-pg-perl 4.27-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.