Doodle::Grammar::Sqlite
Doodle Grammar For SQLite
use Doodle::Grammar::Sqlite; my $self = Doodle::Grammar::Sqlite->new;
This provide determines how command classes should be interpreted to produce the correct DDL statements for Sqlite.
This package inherits behaviors from:
Doodle::Grammar
This package uses type constraints from:
Doodle::Library
This package implements the following methods:
create_column(Command $command) : Str
Returns the SQL statement for the create column command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->primary('id'); my $command = $c->create; $self->create_column($command); # alter table "users" add column "id" integer primary key
create_index(Command $command) : Str
Returns the SQL statement for the create index command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $i = $t->index(columns => ['id']); my $command = $i->create; $self->create_index($command); # create index "indx_users_id" on "users" ("id")
create_table(Command $command) : Str
Returns the SQL statement for the create table command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->column('data'); my $command = $t->create; $self->create_table($command); # create table "users" ("data" varchar)
delete_column(Command $command) : Str
Returns the SQL statement for the delete column command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->primary('id'); my $command = $c->delete; $self->delete_column($command); # alter table "users" drop column "id"
delete_index(Command $command) : Str
Returns the SQL statement for the delete index command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $i = $t->index(columns => ['id']); my $command = $i->delete; $self->delete_index($command); # drop index "indx_users_id"
delete_table(Command $command) : Str
Returns the SQL statement for the delete table command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->column('data'); my $command = $t->delete; $self->delete_table($command); # drop table "users"
rename_table(Command $command) : Str
Returns the SQL statement for the rename table command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->column('data'); my $command = $t->rename('people'); $self->rename_table($command); # alter table "users" rename to "people"
type_binary(Column $column) : Str
Returns the type expression for a binary column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('binary'); $self->type_binary($column); # blob
type_boolean(Column $column) : Str
Returns the type expression for a boolean column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('boolean'); $self->type_boolean($column); # tinyint(1)
type_char(Column $column) : Str
Returns the type expression for a char column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('char'); $self->type_char($column); # varchar
type_date(Column $column) : Str
Returns the type expression for a date column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('date'); $self->type_date($column); # date
type_datetime(Column $column) : Str
Returns the type expression for a datetime column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('datetime'); $self->type_datetime($column); # datetime
type_datetime_tz(Column $column) : Str
Returns the type expression for a datetime_tz column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('datetime_tz'); $self->type_datetime_tz($column); # datetime
type_decimal(Column $column) : Str
Returns the type expression for a decimal column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('decimal'); $self->type_decimal($column); # numeric
type_double(Column $column) : Str
Returns the type expression for a double column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('double'); $self->type_double($column); # float
type_enum(Column $column) : Str
Returns the type expression for a enum column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('enum'); $self->type_enum($column); # varchar
type_float(Column $column) : Str
Returns the type expression for a float column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('float'); $self->type_float($column); # float
type_integer(Column $column) : Str
Returns the type expression for a integer column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer'); $self->type_integer($column); # integer
type_integer_big(Column $column) : Str
Returns the type expression for a integer_big column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_big'); $self->type_integer_big($column); # integer
type_integer_big_unsigned(Column $column) : Str
Returns the type expression for a integer_big_unsigned column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_big_unsigned'); $self->type_integer_big_unsigned($column); # integer
type_integer_medium(Column $column) : Str
Returns the type expression for a integer_medium column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_medium'); $self->type_integer_medium($column); # integer
type_integer_medium_unsigned(Column $column) : Str
Returns the type expression for a integer_medium_unsigned column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_medium_unsigned'); $self->type_integer_medium_unsigned($column); # integer
type_integer_small(Column $column) : Str
Returns the type expression for a integer_small column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_small'); $self->type_integer_small($column); # integer
type_integer_small_unsigned(Column $column) : Str
Returns the type expression for a integer_small_unsigned column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_small_unsigned'); $self->type_integer_small_unsigned($column); # integer
type_integer_tiny(Column $column) : Str
Returns the type expression for a integer_tiny column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_tiny'); $self->type_integer_tiny($column); # integer
type_integer_tiny_unsigned(Column $column) : Str
Returns the type expression for a integer_tiny_unsigned column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_tiny_unsigned'); $self->type_integer_tiny_unsigned($column); # integer
type_integer_unsigned(Column $column) : Str
Returns the type expression for a integer_unsigned column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('integer_unsigned'); $self->type_integer_unsigned($column); # integer
type_json(Column $column) : Str
Returns the type expression for a json column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('json'); $self->type_json($column); # text
type_string(Column $column) : Str
Returns the type expression for a string column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('string'); $self->type_string($column); # varchar
type_text(Column $column) : Str
Returns the type expression for a text column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('text'); $self->type_text($column); # text
type_text_long(Column $column) : Str
Returns the type expression for a text_long column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('text_long'); $self->type_text_long($column); # text
type_text_medium(Column $column) : Str
Returns the type expression for a text_medium column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('text_medium'); $self->type_text_medium($column); # text
type_time(Column $column) : Str
Returns the type expression for a time column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('time'); $self->type_time($column); # time
type_time_tz(Column $column) : Str
Returns the type expression for a time_tz column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('time_tz'); $self->type_time_tz($column); # time
type_timestamp(Column $column) : Str
Returns the type expression for a timestamp column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('timestamp'); $self->type_timestamp($column); # datetime
type_timestamp_tz(Column $column) : Str
Returns the type expression for a timestamp_tz column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('timestamp_tz'); $self->type_timestamp_tz($column); # datetime
type_uuid(Column $column) : Str
Returns the type expression for a uuid column.
# given: synopsis use Doodle; my $ddl = Doodle->new; my $column = $ddl->table('users')->column('uuid'); $self->type_uuid($column); # varchar
update_column(Command $command) : Str
Returns the SQL statement for the update column command.
# given: synopsis use Doodle; my $d = Doodle->new; my $t = $d->table('users'); my $c = $t->primary('id'); my $command = $c->update; $self->update_column($command); # alter table [users] alter column [id] type integer $command = $c->update(set => 'not null'); $self->update_column($command); # alter table [users] alter column [id] set not null
wrap(Str $arg) : Str
Returns a wrapped SQL identifier.
# given: synopsis my $wrapped = $self->wrap('data'); # "data"
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.