DBIx::...erifier(3pm)

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

πŸ’– DBIx::...erifier(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's about DBIx::Class::Helper::Schema::Verifier, which β€” the title got truncated to DBIx::...erifier(3pm) because apparently man pages fear commitment β€” but we know the full name, we're not scared. let's go πŸ¦‹


✨ NAME ✨

DBIx::Class::Helper::Schema::Verifier β€” Verify the Results and ResultSets of your Schemata

like, it checks your schema's stuff. all of it. your exacting standards? met. πŸ’…


✨ SYNOPSIS ✨

package MyApp::Schema;

__PACKAGE__->load_components('Helper::Schema::Verifier');

sub result_verifiers {
  (
     sub {
        my ($self, $result, $set) = @_;

        for ($result, $set) {
           die "$_ does not start with the letter A" unless m/^A/
        }
     },
     shift->next::method,
  )
}

look at that. load the component, write a result_verifiers sub, and suddenly your schema has opinions. main character behaviour fr fr πŸ‘‘


✨ DESCRIPTION ✨

DBIx::Class::Helper::Schema::Verifier is a minuscule framework (her word, not mine, she's humble) that helps you build schemata that match your very own exacting specifications. it is inspired by the author's own travails in discovering that use mro 'c3' is both required and barely documented in much Perl code β€” like, the audacity 😭

as time goes by, the plan is to add many more verifiers, but with this inaugural release she is merely including DBIx::Class::Helper::Schema::Verifier::C3. starting small, staying iconic, we love a debut era 🌸


✨ INTERFACE METHODS ✨

result_verifiers πŸ’–

you must implement result_verifiers in your subclass of ::Verifier. no skipping, bestie, this is the whole assignment.

each verifier gets called on the schema, and gets each result and resultset together as arguments. you can use this to validate almost anything about the results and resultsets of a schema β€” literally almost anything, go feral πŸ¦‹

and contributions are warmly welcomed. like, genuinely. she said warmly. that's an open invitation, iykyk 🫢

✨ MORE ERRORS ✨

ngl, initially this module kept things simple. but after using it in production at ZipRecruiter (https://www.ziprecruiter.com) she found that showing the user the first error that occurred and then just giving up was, and i quote the vibe, pretty annoying πŸ™ˆ

so now Schema::Verifier wraps both load_namespaces in DBIx::Class::Schema and load_classes in DBIx::Class::Schema, and shows all the exceptions encountered as a list at the end of loading all the results.

like, all of them. at once. a little error buffet. iconic, honestly πŸ”₯


✨ AUTHOR ✨

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

(the legend herself ✨)


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. slay, legally speaking πŸ’œ


and that's the whole page, bestie β€” this doc came from perl v5.40.0, dated 2024-11-16, and it lives at DBIx::...erifier(3pm) in the User Contributed Perl Documentation. go forth and verify your schemata, you've got this πŸŽ€β­πŸ’…

πŸ“¦ where this page comes from