GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Class::Helper::Schema::Verifier(3) User Contributed Perl Documentation DBIx::Class::Helper::Schema::Verifier(3)

DBIx::Class::Helper::Schema::Verifier - Verify the Results and ResultSets of your Schemata

 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,
   )
 }

"DBIx::Class::Helper::Schema::Verifier" is a minuscule framework to assist in creating schemata that are to your very own exacting specifications. It is inspired by my own travails in discovering that "use mro 'c3'" is both required and barely documented in much Perl code. As time goes by I expect to add many more verifiers, but with this inaugural release I am merely including DBIx::Class::Helper::Schema::Verifier::C3.

You must implement "result_verifiers" in your subclass of "::Verifier". 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; contributions are warmly welcomed.

Initially I kept this module simple, but after using it in production at ZipRecruiter <https://www.ziprecruiter.com> I found that showing the user the first error that occurred and then giving up was pretty annoying. Now "Schema::Verifier" wraps both "load_namespaces" in DBIx::Class::Schema and "load_classes" in DBIx::Class::Schema and shows all the exceptions encoutered as a list at the end of loading all the results.

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

This software is copyright (c) 2020 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.

2020-03-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.