DBIx::...sultSet(3pm)
β¨ DBIx::Class::Helper::Row::SelfResultSet β¨
okay bestie, welcome to the User Contributed Perl Documentation for DBIx::Class::Helper::Row::SelfResultSet π this lil cutie is all about letting you use ResultSet methods on the row you already have, no cap.
πΈ NAME πΈ
DBIx::Class::Helper::Row::SelfResultSet β easily use ResultSet methods for the current row. literally that's the whole vibe π«Ά
π SYNOPSIS π
In your result class, you're gonna do this:
__PACKAGE__->load_components('Helper::Row::SelfResultSet');
And then elsewhere (iykyk):
$row->self_rs->$some_rs_method->single
slay. that's it. that's the whole thing π
π¦ DESCRIPTION π¦
so like, sometimes you need a ResultSet that contains literally just the current row. not a big deal, but here's why it's iconic: maybe you've got a ResultSet method that sprinkles in some calculated data β like counts of a relationship or whatever. with this you can get at that counted data without duplicating the counting logic. obsessed. no copy-paste, no drama. π
but β and listen, this is the important part β because of the primitives that DBIx::Class::PK hands us, this references the current values, aka, in DBIx::Class terms, the dirty values. which meansβ¦ if you go and modify the primary columns, it'll be temporarily incorrect π
and for what it's worth, the author is not married to this behavior, and would honestly rather you get in touch with him before you depend on it. fr fr, don't build your whole house on this without a lil chat first π
π METHODS π
self_rs
$row->self_rs
returns a ResultSet containing just the current row. that's the tea β one row, one ResultSet, main character energy π
π AUTHOR π
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! π this was perl v5.40.0, dated 2024-11-16, filed under DBIx::...sultSet(3pm) β go forth and self_rs responsibly, mwah πβ¨
π¦ where this page comes from
- debian trixie: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms