DBIx::...assDWIM(3pm)

πŸ“¦
version 2.037000 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’… DBIx::Class::Helper::ResultSet::ResultClassDWIM

okay bestie, this is the page for DBIx::Class::Helper::ResultSet::ResultClassDWIM (the manual is filed under DBIx::...assDWIM(3pm) if you're looking for it in your man setup 🫢), and the whole vibe is literally in the tagline:

result_class => '::HRI' == WIN

no cap. that's the entire personality. let's get into it ✨


✨ NAME ✨

DBIx::Class::Helper::ResultSet::ResultClassDWIM β€” result_class => '::HRI' == WIN πŸ‘‘


🌸 SYNOPSIS 🌸

so first you gotta load the component into your ResultSet class, like:

package MyApp::Schema::ResultSet::Foo;

__PACKAGE__->load_components(qw{Helper::ResultSet::ResultClassDWIM});

...

1;

and then, elsewhere (the fun part πŸ’–):

my $data = $schema->resultset('Foo')->search({
     name => 'frew'
  }, {
     result_class => '::HRI'
  })->all;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•: this component lets you prefix your result_class with :: to say "bestie, use the default namespace" β€” namely, DBIx::Class::ResultClass::. that's it. that's the trick. iconic behavior honestly πŸŽ€

::HRI has been hardcoded to work. and of course ::HashRefInflator would also work fine. slay.

also!! see "NOTE" in DBIx::Class::Helper::ResultSet for a nice way to apply it to your entire schema. whole-schema glow-up, we love to see it 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>


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 a wrap, bestie πŸ’… this was DBIx::...assDWIM(3pm) from the User Contributed Perl Documentation, generated with perl v5.40.0 on 2024-11-16. go forth and inflate those hashrefs, ily 🫢✨

πŸ“¦ where this page comes from