1Mojo::Pg::Transaction(3U)ser Contributed Perl DocumentatiMoonjo::Pg::Transaction(3)
2
3
4

NAME

6       Mojo::Pg::Transaction - Transaction
7

SYNOPSIS

9         use Mojo::Pg::Transaction;
10
11         my $tx = Mojo::Pg::Transaction->new(db => $db);
12         $tx->commit;
13

DESCRIPTION

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

ATTRIBUTES

19       Mojo::Pg::Transaction implements the following attributes.
20
21   db
22         my $db = $tx->db;
23         $tx    = $tx->db(Mojo::Pg::Database->new);
24
25       Mojo::Pg::Database object this transaction belongs to. Note that this
26       attribute is weakened.
27

METHODS

29       Mojo::Pg::Transaction inherits all methods from Mojo::Base and
30       implements the following new ones.
31
32   commit
33         $tx->commit;
34
35       Commit transaction.
36
37   new
38         my $tx = Mojo::Pg::Transaction->new;
39         my $tx = Mojo::Pg::Transaction->new(db => Mojo::Pg::Database->new);
40         my $tx = Mojo::Pg::Transaction->new({db => Mojo::Pg::Database->new});
41
42       Construct a new Mojo::Pg::Transaction object.
43

SEE ALSO

45       Mojo::Pg, Mojolicious::Guides, <https://mojolicious.org>.
46
47
48
49perl v5.32.0                      2020-07-28          Mojo::Pg::Transaction(3)
Impressum