logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Mojo::Pg::Transaction - Transaction

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.

Description

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

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.

Name

       Mojo::Pg::Transaction - Transaction

See Also

       Mojo::Pg, Mojolicious::Guides, <https://mojolicious.org>.

perl v5.34.0                                       2022-03-19                         Mojo::Pg::Transaction(3pm)

Synopsis

         use Mojo::Pg::Transaction;

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

See Also