NAME
Doodle::Column::Helpers
ABSTRACT
Doodle Column Helpers
SYNOPSIS
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
);
DESCRIPTION
Helpers for configuring Column classes.
LIBRARIES
This package uses type constraints from:
METHODS
This package implements the following methods:
binary
binary(Any %args) : Column
Configures a binary column and returns itself.
boolean
boolean(Any %args) : Column
Configures a boolean column and returns itself.
char
char(Any %args) : Column
Configures a char column and returns itself.
date
date(Any %args) : Column
Configures a date column and returns itself.
datetime
datetime(Any %args) : Column
Configures a datetime column and returns itself.
datetime_tz
datetime_tz(Any %args) : Column
Configures a datetime column with timezone and returns itself.
decimal
decimal(Any %args) : Column
Configures a decimal column and returns itself.
default
default(Str @args) : Column
Configures a default value and returns itself.
- default example #2
-
# given: synopsis my $default = $self->default(string => 123); # produces, default '123'
- default example #3
-
# given: synopsis my $default = $self->default(integer => 123); # produces, default 123
- default example #4
-
# given: synopsis my $default = $self->default(function => 'current_timestamp'); # produces, default CURRENT_TIMESTAMP
default_current_date
default_current_date() : Column
Configures a CURRENT_DATE
default value and returns itself.
default_current_datetime
default_current_datetime() : Column
Configures a CURRENT_TIMESTAMP
default value and returns itself.
- default_current_datetime example #1
-
# given: synopsis my $default = $self->default_current_datetime;
default_current_time
default_current_time() : Column
Configures a CURRENT_TIME
default value and returns itself.
double
double(Any %args) : Column
Configures a double column and returns itself.
enum
enum(Any %args) : Column
Configures an enum column and returns itself.
float
float(Any %args) : Column
Configures a float column and returns itself.
increments
increments() : Column
Denotes that the column auto-increments and returns the Column object.
increments_big
increments_big(Any %args) : Column
Configures an auto-incrementing big integer (8-byte) column and returns itself.
increments_medium
increments_medium(Any %args) : Column
Configures an auto-incrementing medium integer (3-byte) column and returns itself.
increments_small
increments_small(Any %args) : Column
Configures an auto-incrementing small integer (2-byte) column and returns itself.
integer
integer(Any %args) : Column
Configures an integer (4-byte) column and returns itself.
integer_big
integer_big(Any %args) : Column
Configures a big integer (8-byte) column and returns itself.
integer_big_unsigned
integer_big_unsigned(Any %args) : Column
Configures an unsigned big integer (8-byte) column and returns itself.
- integer_big_unsigned example #1
-
# given: synopsis my $integer_big_unsigned = $self->integer_big_unsigned;
integer_medium
integer_medium(Any %args) : Column
Configures a medium integer (3-byte) column and returns itself.
integer_medium_unsigned
integer_medium_unsigned(Any %args) : Column
Configures an unsigned medium integer (3-byte) column and returns itself.
- integer_medium_unsigned example #1
-
# given: synopsis my $integer_medium_unsigned = $self->integer_medium_unsigned;
integer_small
integer_small(Any %args) : Column
Configures a small integer (2-byte) column and returns itself.
integer_small_unsigned
integer_small_unsigned(Any %args) : Column
Configures an unsigned small integer (2-byte) column and returns itself.
- integer_small_unsigned example #1
-
# given: synopsis my $integer_small_unsigned = $self->integer_small_unsigned;
integer_tiny
integer_tiny(Any %args) : Column
Configures a tiny integer (1-byte) column and returns itself.
integer_tiny_unsigned
integer_tiny_unsigned(Any %args) : Column
Configures an unsigned tiny integer (1-byte) column and returns itself.
- integer_tiny_unsigned example #1
-
# given: synopsis my $integer_tiny_unsigned = $self->integer_tiny_unsigned;
integer_unsigned
integer_unsigned(Any %args) : Column
Configures an unsigned integer (4-byte) column and returns itself.
json
json(Any %args) : Column
Configures a JSON column and returns itself.
not_null
not_null(Any %args) : Column
Denotes that the Column is not nullable and returns itself.
null
null(Any %args) : Column
Denotes that the Column is nullable and returns itself.
primary
primary(Any %args) : Column
Denotes that the column is the primary key and returns the Column object.
references
references(Str $table, Str $column) : Relation
Configures a relation and returns the Relation object.
string
string(Any %args) : Column
Configures a string column and returns itself.
text
text(Any %args) : Column
Configures a text column and returns itself.
text_long
text_long(Any %args) : Column
Configures a long text column and returns itself.
text_medium
text_medium(Any %args) : Column
Configures a medium text column and returns itself.
time
time(Any %args) : Column
Configures a time column and returns itself.
time_tz
time_tz(Any %args) : Column
Configures a time column with timezone and returns itself.
timestamp
timestamp(Any %args) : Column
Configures a timestamp column and returns itself.
timestamp_tz
timestamp_tz(Any %args) : Column
Configures a timestamp_tz column and returns itself.
uuid
uuid(Any %args) : Column
Configures a uuid column and returns itself.
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
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".