1Mojo::Pg::Transaction(3U)ser Contributed Perl DocumentatiMoonjo::Pg::Transaction(3)
2
3
4
6 Mojo::Pg::Transaction - Transaction
7
9 use Mojo::Pg::Transaction;
10
11 my $tx = Mojo::Pg::Transaction->new(db => $db);
12 $tx->commit;
13
15 Mojo::Pg::Transaction is a scope guard for DBD::Pg transactions used by
16 Mojo::Pg::Database.
17
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
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
45 Mojo::Pg, Mojolicious::Guides, <https://mojolicious.org>.
46
47
48
49perl v5.34.0 2021-07-22 Mojo::Pg::Transaction(3)