The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojo::mysql::Transaction - Transaction

SYNOPSIS

  use Mojo::mysql::Transaction;

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

DESCRIPTION

Mojo::mysql::Transaction is a cope guard for DBD::mysql transactions used by Mojo::mysql::Database.

ATTRIBUTES

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

db

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

Mojo::mysql::Database object this transaction belongs to.

METHODS

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

commit

  $tx = $tx->commit;

Commit transaction.

new

  my $tx = Mojo::mysql::Transaction->new;

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

SEE ALSO

Mojo::mysql.