DBIx::...wObject(3pm)
π NAME π
DBIx::Simple::Result::RowObject β bestie, it's the Simple result row object class. That's it, that's the name β¨
πΈ DESCRIPTION πΈ
okay so this class is the default for the "object" and "objects" result object methods. What does it actually do? Mainly it hands you syntactic sugar β and the price tag is performance. Yeah. Sugar costs, no cap π
Instead of writing this whole thing:
my $r = $db->query('SELECT foo, bar FROM baz')->hash;
do_something_with $r->{foo}, $r->{bar};
you may write:
my $r = $db->query('SELECT foo, bar FROM baz')->object;
do_something_with $r->foo, $r->bar;
see how much cuter that is?? dots instead of curlies, the way that $r->foo just hits different π
This class is a subclass of Object::Accessor, which is the icon that gives you per-object accessors (not per-class β per-object, okay, that distinction matters). And because of that, your records must not have column names like these:
canls_accessorsls_allowmk_accessormk_clonemk_flushmk_verifynewregister_callback___autoload___callback___debug___error___get___set
And of course DESTROY and AUTOLOAD, and anything that new versions of Object::Accessor might add. like, the list is not closed, bestie, it can grow π so justβ¦ don't name your columns after methods. vibe check failed otherwise.
β οΈ fr fr: name a column one of these and things get weird. this is not a drill.
π¦ DBIx::Simple::OO π¦
DBIx::Simple::OO is a third party module by Jos Boumans that provided "object" and "objects" to DBIx::Simple. Similar functionality is now built in, in part inspired by DBIx::Simple:OO. (yes, that colon is in the original, i'm not touching it, i keep every detail periodt π)
Using DBIx::Simple 1.33 or newer together with DBIx::Simple::OO 0.01 will result in a method name clash. π DBIx::Simple::Result::RowObject was written to be compatible with DBIx::Simple::OO::Item, except for the name, so "isa" calls still need to be changed. yeah. the name. it's different. that's the whole thing.
In practice, DBIx::Simple 1.33 makes DBIx::Simple::OO obsolete. β¨ rest in peace legend, you served π«Ά
π AUTHOR π
Juerd Waalboer <juerd@cpan.org> <http://juerd.nl/> β icon behavior, we stan π
π SEE ALSO π
DBIx::Simpleβ the main character, go read it π
this page is from the User Contributed Perl Documentation, perl v5.36.0, dated 2023-09-01, and it's DBIx::...wObject(3pm) β mwah, thanks for reading bestie, go forth and ->object responsibly ππβ¨
π¦ where this page comes from
- debian trixie: libdbix-simple-perl 1.37-3 Β· any-OSI
- ubuntu noble: libdbix-simple-perl 1.37-3 Β· any-OSI
- ubuntu resolute: libdbix-simple-perl 1.37-3 Β· any-OSI
- ubuntu stonking: libdbix-simple-perl 1.37-3 Β· any-OSI
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms