NAME

Mojo::Pg::Transaction - Transaction

SYNOPSIS

use Mojo::Pg::Transaction;

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

DESCRIPTION

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

ATTRIBUTES

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

dbh

my $dbh = $tx->dbh;
$tx     = $tx->dbh($dbh);

DBD::Pg database handle this transaction belongs to.

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;

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

SEE ALSO

Mojo::Pg, Mojolicious::Guides, http://mojolicio.us.