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
SQL::Translator::Types(3) User Contributed Perl Documentation SQL::Translator::Types(3)

SQL::Translator::Types - Type checking functions

    package Foo;
    use Moo;
    use SQL::Translator::Types qw(schema_obj enum);

    has foo => ( is => 'rw', isa => schema_obj('Trigger') );
    has bar => ( is => 'rw', isa => enum([qw(baz quux quuz)], {
        msg => "Invalid value for bar: '%s'", icase => 1,
    });

This module exports functions that return coderefs suitable for Moo "isa" type checks. Errors are reported using "throw" in SQL::Translator::Utils.

Returns a coderef that checks that its arguments is an object of the class "SQL::Translator::Schema::$type".

Returns a coderef that checks that the argument is one of the provided @strings.

Parameters

msg
sprintf string for the error message. If no other parameters are needed, this can be provided on its own, instead of the %parameters hashref. The invalid value is passed as the only argument. Defaults to "Invalid value: '%s'".
icase
If true, folds the values to lower case before checking for equality.
allow_undef
If true, allow "undef" in addition to the specified strings.
allow_false
If true, allow any false value in addition to the specified strings.
2018-06-13 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.