Wallet::Database(3pm)

πŸ“¦ version 1.7, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Wallet::Dabase β€” bestie, it's the wrapper module for wallet database connections. (yes the source spells it Dabase, we don't fix it, we respect it 🫢)


✨ SYNOPSIS ✨

use Wallet::Database;
my $dbh = Wallet::Database->connect;

like. two lines. that's the whole vibe. πŸ’…


🌸 DESCRIPTION 🌸

Wallet::Database is a thin wrapper module around DBI that handles the annoying parts for you: building a connect string and setting database options, all based on your wallet configuration. no cap.

The only method it overrides is connect(). Every other method does exactly what it does in DBI, and Wallet::Database objects are usable exactly as if they were DBI objects. so you can just. keep using them. iconic behavior honestly. πŸ‘‘

connect() pulls the database connection info straight out of the wallet configuration β€” go read Wallet::Config for the deets. And it auto-sets:

  • RaiseError to true βœ…
  • PrintError to false
  • AutoCommit to false

which matches the assumptions the wallet database code makes. it's giving "we already agreed on this, no need to ask." 😌


πŸŽ€ CLASS METHODS πŸŽ€

πŸ’œ connect()

Opens a fresh database connection and hands you back the database object. If anything goes wrong, it throws an exception. πŸ’€

And here's the slay: unlike the DBI method, this connect() takes no arguments. zero. none. all the database connection info comes from the wallet configuration. periodt. πŸ¦‹


πŸ”₯ SEE ALSO πŸ”₯

This module is part of the wallet system. The current version lives at <https://www.eyrie.org/~eagle/software/wallet/> β€” go get it bestie ✨


🌈 AUTHOR 🌈

Russ Allbery <eagle@eyrie.org> πŸ’–


and that's the whole page, mwah πŸ’‹ this was perl v5.40.0, dated 2024-11-12, filed under Wallet::Database(3pm) β€” love that for us, bye bestie! πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from