++ed by:

2 non-PAUSE users.

Al Newkirk

NAME

Doodle::Table::Helpers

ABSTRACT

Doodle Table Helpers

SYNOPSIS

  use Doodle::Table;

  my $self = Doodle::Table->new(
    name => 'users'
  );

DESCRIPTION

Helpers for configuring Table classes.

METHODS

This package implements the following methods.

binary

  binary(Str $name, Any %args) : Column

Registers a binary column and returns the Command object set.

binary example
  my $binary = $self->binary('resume');

boolean

  boolean(Str $name, Any %args) : Column

Registers a boolean column and returns the Command object set.

boolean example
  my $boolean = $self->boolean('verified');

char

  char(Str $name, Any %args) : Column

Registers a char column and returns the Command object set.

char example
  my $char = $self->char('level', size => 2);

date

  date(Str $name, Any %args) : Column

Registers a date column and returns the Command object set.

date example
  my $date = $self->date('start_date');

datetime

  datetime(Str $name, Any %args) : Column

Registers a datetime column and returns the Command object set.

datetime example
  my $datetime = $self->datetime('published_at');

datetime_tz

  datetime_tz(Str $name, Any %args) : Column

Registers a datetime column with timezone and returns the Command object set.

datetime_tz example
  my $datetime_tz = $self->datetime_tz('published_at');

decimal

  decimal(Str $name, Any %args) : Column

Registers a decimal column and returns the Command object set.

decimal example
  my $decimal = $self->decimal('point');

double

  double(Str $name, Any %args) : Column

Registers a double column and returns the Command object set.

double example
  my $double = $self->double('amount');

enum

  enum(Str $name, Any %args) : Column

Registers an enum column and returns the Command object set.

enum example
  my $enum = $self->enum('colors', options => [
    'red', 'blue', 'green'
  ]);

float

  float(Str $name, Any %args) : Column

Registers a float column and returns the Command object set.

float example
  my $float = $self->float('amount');

if_exists

  if_exists() : Table

Used with the delete method to denote that the table should be deleted only if it already exists.

if_exists example
  $self->if_exists;

if_not_exists

  if_not_exists() : Table

Used with the create method to denote that the table should be created only if it doesn't already exist.

if_not_exists example
  $self->if_not_exists;

increments_big

  increments_big(Str $name, Any %args) : Column

Registers an auto-incrementing big integer (8-byte) column and returns the Command object set.

increments_big example
  my $increments_big = $self->increments_big('number');

increments_medium

  increments_medium(Str $name, Any %args) : Column

Registers an auto-incrementing medium integer (3-byte) column and returns the Command object set.

increments_medium example
  my $increments_medium = $self->increments_medium('number');

increments_small

  increments_small(Str $name, Any %args) : Column

Registers an auto-incrementing small integer (2-byte) column and returns the Command object set.

increments_small example
  my $increments_small = $self->increments_small('number');

integer

  integer(Str $name, Any %args) : Column

Registers an integer (4-byte) column and returns the Command object set.

integer example
  my $integer = $self->integer('number');

integer_big

  integer_big(Str $name, Any %args) : Column

Registers a big integer (8-byte) column and returns the Command object set.

integer_big example
  my $integer_big = $self->integer_big('number');

integer_big_unsigned

  integer_big_unsigned(Str $name, Any %args) : Column

Registers an unsigned big integer (8-byte) column and returns the Command object set.

integer_big_unsigned example
  my $integer_big_unsigned = $self->integer_big_unsigned('number');

integer_medium

  integer_medium(Str $name, Any %args) : Column

Registers a medium integer (3-byte) column and returns the Command object set.

integer_medium example
  my $integer_medium = $self->integer_medium('number');

integer_medium_unsigned

  integer_medium_unsigned(Str $name, Any %args) : Column

Registers an unsigned medium integer (3-byte) column and returns the Command object set.

integer_medium_unsigned example
  my $integer_medium_unsigned = $self->integer_medium_unsigned('number');

integer_small

  integer_small(Str $name, Any %args) : Column

Registers a small integer (2-byte) column and returns the Command object set.

integer_small example
  my $integer_small = $self->integer_small('number');

integer_small_unsigned

  integer_small_unsigned(Str $name, Any %args) : Column

Registers an unsigned small integer (2-byte) column and returns the Command object set.

integer_small_unsigned example
  my $integer_small_unsigned = $self->integer_small_unsigned('number');

integer_tiny

  integer_tiny(Str $name, Any %args) : Column

Registers a tiny integer (1-byte) column and returns the Command object set.

integer_tiny example
  my $integer_tiny = $self->integer_tiny('number');

integer_tiny_unsigned

  integer_tiny_unsigned(Str $name, Any %args) : Column

Registers an unsigned tiny integer (1-byte) column and returns the Command object set.

integer_tiny_unsigned example
  my $integer_tiny_unsigned = $self->integer_tiny_unsigned('number');

integer_unsigned

  integer_unsigned(Str $name, Any %args) : Column

Registers an unsigned integer (4-byte) column and returns the Command object set.

integer_unsigned example
  my $integer_unsigned = $self->integer_unsigned('number');

json

  json(Str $name, Any %args) : Column

Registers a JSON column and returns the Command object set.

json example
  my $json = $self->json('metadata');

morphs

  morphs(Str $name) : [Column]

Registers columns neccessary for polymorphism and returns the Column object set.

morphs example
  my $morphs = $self->morphs('parent');

no_morphs

  no_morphs(Str $name) : [Command]

Registers a drop for {name}_fkey and {name}_type polymorphic columns and returns the Command object set.

no_morphs example
  my $no_morphs = $self->no_morphs('profile');

no_timestamps

  no_timestamps() : [Command]

Registers a drop for created_at, updated_at and deleted_at columns and returns the Command object set.

no_timestamps example
  my $no_timestamps = $self->no_timestamps;

primary

  primary(Str $name, Any %args) : Column

Registers primary key(s) and returns the Command object set.

primary example
  my $primary = $self->primary('id');

string

  string(Str $name, Any %args) : Column

Registers a string column and returns the Command object set.

string example
  my $string = $self->string('fname');

temporary

  temporary() : Table

Denotes that the table created should be a temporary one.

temporary example
  my $temporary = $self->temporary;

text

  text(Str $name, Any %args) : Column

Registers a text column and returns the Command object set.

text example
  my $text = $self->text('biography');

text_long

  text_long(Str $name, Any %args) : Column

Registers a long text column and returns the Command object set.

text_long example
  my $text_long = $self->text_long('biography');

text_medium

  text_medium(Str $name, Any %args) : Column

Registers a medium text column and returns the Command object set.

text_medium example
  my $text_medium = $self->text_medium('biography');

time

  time(Str $name, Any %args) : Column

Registers a time column and returns the Command object set.

time example
  my $time = $self->time('clock_in');

time_tz

  time_tz(Str $name, Any %args) : Column

Registers a time column with timezone and returns the Command object set.

time_tz example
  my $time_tz = $self->time_tz('clock_in');

timestamp

  timestamp(Str $name, Any %args) : Column

Registers a timestamp column and returns the Command object set.

timestamp example
  my $timestamp = $self->timestamp('verified');

timestamp_tz

  timestamp_tz(Str $name, Any %args) : Column

Registers a timestamp_tz column and returns the Command object set.

timestamp_tz example
  my $timestamp_tz = $self->timestamp_tz('verified');

timestamps

  timestamps() : [Column]

Registers created_at, updated_at and deleted_at columns and returns the Command object set.

timestamps example
  my $timestamps = $self->timestamps;

timestamps_tz

  timestamps_tz() : [Column]

Registers created_at, updated_at and deleted_at columns with timezone and returns the Command object set.

timestamps_tz example
  my $timestamps_tz = $self->timestamps_tz;

uuid

  uuid(Str $name, Any %args) : Column

Registers a uuid column and returns the Command object set.

uuid example
  my $uuid = $self->uuid('reference');