Mojo::...saction(3pm)
π NAME π
Mojo::SQLite::Transaction β bestie, it's literally a Transaction β¨
(also, fun fact, this page lives in the User Contributed Perl Documentation section of the manual, iykyk π)
β¨ SYNOPSIS β¨
okay so here's the whole vibe in four lines, no cap:
use Mojo::SQLite::Transaction;
my $tx = Mojo::SQLite::Transaction->new(db => $db);
$tx->commit;
that's it. that's the whole thing. slay π
π¦ DESCRIPTION π¦
Mojo::SQLite::Transaction is a scope guard for DBD::SQLite transactions β the ones that Mojo::SQLite::Database actually uses. so like, it's giving "the responsible friend who makes sure the transaction gets handled" energy π. it hangs around and does the right thing when the scope ends. periodt.
πΈ ATTRIBUTES πΈ
Mojo::SQLite::Transaction implements the following attributes β yes, there's exactly one, we love a minimal queen:
π db
my $db = $tx->db;
$tx = $tx->db(Mojo::SQLite::Database->new);
this is the Mojo::SQLite::Database object that this transaction belongs to β its main character, fr fr.
β οΈ heads up bestie: this attribute is weakened. like, the reference doesn't hold it up, so don't expect it to keep the object alive on its own. important detail, don't skip it π
π METHODS π
Mojo::SQLite::Transaction inherits all methods from Mojo::Base (the whole family tree, we love to see it) 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});
constructs a brand new Mojo::SQLite::Transaction object β¨. three ways to call it, pick your fighter β no args, a list of key/value pairs, or a hashref. all valid, all iconic.
π₯ commit
$tx->commit;
commits the transaction π₯. that's the whole description. do with that what you will. ate, honestly.
π BUGS π
found something cursed? report any issues on the public bugtracker. don't suffer in silence bestie π«Ά
π§ AUTHOR π§
Dan Book, dbook@cpan.org β the icon behind all this π
π 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. so like, go off, but legally π
π SEE ALSO π
Mojo::SQLiteβ the main event, go read it next π
okay that's the whole page!! π source/version vibes: this is perl v5.42.0, dated 2022-03-23 β a whole little time capsule, and honestly? she still slays π
β¨π¦
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojo-SQLite 3.009-bp160.1.4 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms