CXC-DB-DDL
view release on metacpan or search on metacpan
lib/CXC/DB/DDL/Field.pm view on Meta::CPAN
package CXC::DB::DDL::Field;
# ABSTRACT: DDL Representation of a field
use v5.26;
use List::Util qw( first );
use Ref::Util qw( is_coderef is_ref );
use CXC::DB::DDL::Failure;
use CXC::DB::DDL::Constants -all;
use Types::Standard qw( ArrayRef Bool CodeRef Dict Enum HashRef Int Optional ScalarRef );
use Types::Common::String qw( NonEmptyStr );
use Moo;
use experimental 'signatures', 'postderef', 'declared_refs', 'refaliasing';
our $VERSION = '0.21';
use namespace::clean -except => [ 'has', '_tag_list', '_tags' ];
use MooX::StrictConstructor;
# need _tag_list for CloneClear (MooX::TaggedAttributes)
# need new for MooX::StrictConstructor
with 'CXC::DB::DDL::CloneClear';
has name => (
is => 'ro',
isa => NonEmptyStr,
required => 1,
);
has data_type => (
is => 'ro',
isa => ArrayRef->of( Enum [SQL_TYPE_CONSTANTS] )->plus_coercions( Int, sub { [$_] } ),
coerce => 1,
required => 1,
);
has is_nullable => (
is => 'ro',
isa => Bool,
default => 0,
);
( run in 1.483 second using v1.01-cache-2.11-cpan-364913b4093 )