PGObje...Method(3pm)
π PGObject::Util::DBMethod π
okay bestie, welcome to the manual page for PGObject::Util::DBMethod β part of the User Contributed Perl Documentation, and fr fr it's the little helper that lets you map your stored procedures to objects without wanting to scream. PGObject::Util::DBMethod does declarative stored procedure β object mappings for the PGObject Framework. it's giving "I wrote the boilerplate so you don't have to." β¨
πΈ VERSION πΈ
Version 1.01.000 β she's grown, she's stable, she's cute. π
π¦ SYNOPSIS π¦
so like. without PGObject::Util::DBobject, you would be out here writing this whole thing by hand like a peasant:
sub mymethod {
my ($self) = @_;
return $self->call_dbmethod(funcname => 'foo');
}
π the DRAMA. the repetition. the way that you type sub and my ($self) = @_; for the hundredth time.
With this module you'd do this instead, and it's so much shorter it's basically a glow-up:
dbmethod mymethod => (funcname => 'foo');
periodt. one line. ate. π₯
π EXPORT π
This exports only dbmethod, which it always exports. no opt-in, no asking politely, she just shows up. π«Ά
β¨ SUBROUTINES/METHODS β¨
π dbmethod
use it like dbmethod (name => (default_arghash)) β that's the shape, bestie. name on the left, hashref of defaults on the right, slay.
For example:
package MyObject;
use PGObject::Utils::DBMethod;
dbmethod save => (
strict_args => 0,
funcname => 'save_user',
funcschema => 'public',
args => { admin => 0 },
);
$MyObject->save(args => {username => 'foo', password => 'bar'});
(no, we are not fixing that indentation, that's just how it is, it's part of the vibe now π)
π Special arguments are:
arg_litβ It set must point to a hashref. Used to allow mapping of function arguments to arg hash elements. If this is set thenfuncname,funcschema, etc, cannot be overwritten on the call. π« (yes, it locks them down β read that part twice, it's the whole point)strict_argsβ If true, args override args provided by user.returns_objectsβ If true, bless returned hashrefs before returning them. β¨merge_backβ If true, merges the first record back to the$selfat the end before returning, and returns$self. Note this is a copy only one layer deep which is fine for the use case of merging return values from the database into the current object.
β οΈ heads up bestie β that merge_back one is a shallow copy, one layer deep, no cap. it's fine for what it's for (merging DB return values into your current object) but don't go expecting deep magic, she's not that kind of girl.
π§ AUTHOR π§
Chris Travers, "<chris.travers at gmail.com>" β the icon who made this happen. π
π BUGS π
found a bug or want a feature? Please report any bugs or feature requests to "bug-pgobject-util-dbmethod at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PGObject-Util-DBMethod>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. π«Ά so like, you're not yelling into the void, the void yells back. that's the deal.
π SUPPORT π
You can find documentation for this module with the perldoc command. classic. iconic.
perldoc PGObject::Util::DBMethod
You can also look for information at:
- RT: CPAN's request tracker (report bugs here) π
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Util-DBMethod>
- AnnoCPAN: Annotated CPAN documentation π
<http://annocpan.org/dist/PGObject-Util-DBMethod>
- CPAN Ratings β
<http://cpanratings.perl.org/d/PGObject-Util-DBMethod>
- Search CPAN π
<http://search.cpan.org/dist/PGObject-Util-DBMethod/>
πΈ ACKNOWLEDGEMENTS πΈ
(yeah bestie, this section is literally empty in the original too. she's a mystery. we respect that. π³οΈπ)
π LICENSE AND COPYRIGHT π
Copyright 2014 Chris Travers.
This program is released under the following license: BSD
and that's the whole page, bestie!! πβ¨ this one's from perl v5.32.1, dated 2021-11-08, and it's still out here being PGObje...Method(3pm) (the ellipsis is just the terminal being shy about long names, not me being lazy π). go forth and map your stored procedures. mwah. π
ππ¦
π¦ where this page comes from
- debian bookworm: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- debian trixie: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- ubuntu jammy: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- ubuntu noble: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- ubuntu resolute: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- ubuntu stonking: libpgobject-util-dbmethod-perl 1.01.000-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms