Doodle::Column::Helpers
Doodle Column Helpers
use Doodle::Column; use Doodle; use Doodle::Column; use Doodle::Table; my $ddl = Doodle->new; my $table = Doodle::Table->new( name => 'users', doodle => $ddl ); my $self = Doodle::Column->new( name => 'id', table => $table, doodle => $ddl );
Helpers for configuring Column classes.
This package uses type constraints from:
Doodle::Library
This package implements the following methods:
binary(Any %args) : Column
Configures a binary column and returns itself.
# given: synopsis my $binary = $self->binary;
boolean(Any %args) : Column
Configures a boolean column and returns itself.
# given: synopsis my $boolean = $self->boolean;
char(Any %args) : Column
Configures a char column and returns itself.
# given: synopsis my $char = $self->char;
date(Any %args) : Column
Configures a date column and returns itself.
# given: synopsis my $date = $self->date;
datetime(Any %args) : Column
Configures a datetime column and returns itself.
# given: synopsis my $datetime = $self->datetime;
datetime_tz(Any %args) : Column
Configures a datetime column with timezone and returns itself.
# given: synopsis my $datetime_tz = $self->datetime_tz;
decimal(Any %args) : Column
Configures a decimal column and returns itself.
# given: synopsis my $decimal = $self->decimal;
default(Str @args) : Column
Configures a default value and returns itself.
# given: synopsis my $default = $self->default(123); # produces, default 123
# given: synopsis my $default = $self->default(string => 123); # produces, default '123'
# given: synopsis my $default = $self->default(integer => 123); # produces, default 123
# given: synopsis my $default = $self->default(function => 'current_timestamp'); # produces, default CURRENT_TIMESTAMP
default_current_date() : Column
Configures a CURRENT_DATE default value and returns itself.
CURRENT_DATE
# given: synopsis my $default = $self->default_current_date;
default_current_datetime() : Column
Configures a CURRENT_TIMESTAMP default value and returns itself.
CURRENT_TIMESTAMP
# given: synopsis my $default = $self->default_current_datetime;
default_current_time() : Column
Configures a CURRENT_TIME default value and returns itself.
CURRENT_TIME
# given: synopsis my $default = $self->default_current_time;
double(Any %args) : Column
Configures a double column and returns itself.
# given: synopsis my $double = $self->double;
enum(Any %args) : Column
Configures an enum column and returns itself.
# given: synopsis my $enum = $self->enum(options => [ 'red', 'blue', 'green' ]);
float(Any %args) : Column
Configures a float column and returns itself.
# given: synopsis my $float = $self->float;
increments() : Column
Denotes that the column auto-increments and returns the Column object.
# given: synopsis my $increments = $self->increments;
increments_big(Any %args) : Column
Configures an auto-incrementing big integer (8-byte) column and returns itself.
# given: synopsis my $increments_big = $self->increments_big;
increments_medium(Any %args) : Column
Configures an auto-incrementing medium integer (3-byte) column and returns itself.
# given: synopsis my $increments_medium = $self->increments_medium;
increments_small(Any %args) : Column
Configures an auto-incrementing small integer (2-byte) column and returns itself.
# given: synopsis my $increments_small = $self->increments_small;
integer(Any %args) : Column
Configures an integer (4-byte) column and returns itself.
# given: synopsis my $integer = $self->integer;
integer_big(Any %args) : Column
Configures a big integer (8-byte) column and returns itself.
# given: synopsis my $integer_big = $self->integer_big;
integer_big_unsigned(Any %args) : Column
Configures an unsigned big integer (8-byte) column and returns itself.
# given: synopsis my $integer_big_unsigned = $self->integer_big_unsigned;
integer_medium(Any %args) : Column
Configures a medium integer (3-byte) column and returns itself.
# given: synopsis my $integer_medium = $self->integer_medium;
integer_medium_unsigned(Any %args) : Column
Configures an unsigned medium integer (3-byte) column and returns itself.
# given: synopsis my $integer_medium_unsigned = $self->integer_medium_unsigned;
integer_small(Any %args) : Column
Configures a small integer (2-byte) column and returns itself.
# given: synopsis my $integer_small = $self->integer_small;
integer_small_unsigned(Any %args) : Column
Configures an unsigned small integer (2-byte) column and returns itself.
# given: synopsis my $integer_small_unsigned = $self->integer_small_unsigned;
integer_tiny(Any %args) : Column
Configures a tiny integer (1-byte) column and returns itself.
# given: synopsis my $integer_tiny = $self->integer_tiny;
integer_tiny_unsigned(Any %args) : Column
Configures an unsigned tiny integer (1-byte) column and returns itself.
# given: synopsis my $integer_tiny_unsigned = $self->integer_tiny_unsigned;
integer_unsigned(Any %args) : Column
Configures an unsigned integer (4-byte) column and returns itself.
# given: synopsis my $integer_unsigned = $self->integer_unsigned;
json(Any %args) : Column
Configures a JSON column and returns itself.
# given: synopsis my $json = $self->json;
not_null(Any %args) : Column
Denotes that the Column is not nullable and returns itself.
# given: synopsis my $not_null = $self->not_null;
null(Any %args) : Column
Denotes that the Column is nullable and returns itself.
# given: synopsis my $null = $self->null;
primary(Any %args) : Column
Denotes that the column is the primary key and returns the Column object.
# given: synopsis my $primary = $self->primary('id');
references(Str $table, Str $column) : Relation
Configures a relation and returns the Relation object.
# given: synopsis my $references = $self->references('entities');
# given: synopsis my $references = $self->references('entities', 'uuid');
string(Any %args) : Column
Configures a string column and returns itself.
# given: synopsis my $string = $self->string;
text(Any %args) : Column
Configures a text column and returns itself.
# given: synopsis my $text = $self->text;
text_long(Any %args) : Column
Configures a long text column and returns itself.
# given: synopsis my $text_long = $self->text_long;
text_medium(Any %args) : Column
Configures a medium text column and returns itself.
# given: synopsis my $text_medium = $self->text_medium;
time(Any %args) : Column
Configures a time column and returns itself.
# given: synopsis my $time = $self->time;
time_tz(Any %args) : Column
Configures a time column with timezone and returns itself.
# given: synopsis my $time_tz = $self->time_tz;
timestamp(Any %args) : Column
Configures a timestamp column and returns itself.
# given: synopsis my $timestamp = $self->timestamp;
timestamp_tz(Any %args) : Column
Configures a timestamp_tz column and returns itself.
# given: synopsis my $timestamp_tz = $self->timestamp_tz;
uuid(Any %args) : Column
Configures a uuid column and returns itself.
# given: synopsis my $uuid = $self->uuid;
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Doodle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Doodle
CPAN shell
perl -MCPAN -e shell install Doodle
For more information on module installation, please visit the detailed CPAN module installation guide.