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.
26
28 Mojo::Pg::Transaction inherits all methods from Mojo::Base and
29 implements the following new ones.
30
31 commit
32 $tx->commit;
33
34 Commit transaction.
35
36 new
37 my $tx = Mojo::Pg::Transaction->new;
38 my $tx = Mojo::Pg::Transaction->new(db => Mojo::Pg::Database->new);
39 my $tx = Mojo::Pg::Transaction->new({db => Mojo::Pg::Database->new});
40
41 Construct a new Mojo::Pg::Transaction object.
42
44 Mojo::Pg, Mojolicious::Guides, <https://mojolicious.org>.
45
46
47
48perl v5.28.0 2018-05-08 Mojo::Pg::Transaction(3)