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

NAME

Mojo::SQLite::Transaction - Transaction

SYNOPSIS

  use Mojo::SQLite::Transaction;

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

DESCRIPTION

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

ATTRIBUTES

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

db

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

Mojo::SQLite::Database object this transaction belongs to. Note that this attribute is weakened.

METHODS

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

new

  my $tx = Mojo::SQLite::Transaction->new;
  my $tx = Mojo::SQLite::Transaction->new(db => Mojo::SQLite::Database->new);
  my $tx = Mojo::SQLite::Transaction->new({db => Mojo::SQLite::Database->new});

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

commit

  $tx->commit;

Commit transaction.

BUGS

Report any issues on the public bugtracker.

AUTHOR

Dan Book, dbook@cpan.org

COPYRIGHT AND LICENSE

Copyright 2015, Dan Book.

This library is free software; you may redistribute it and/or modify it under the terms of the Artistic License version 2.0.

SEE ALSO

Mojo::SQLite