Properties

$wrapper

$wrapper : string

The keyword identifier for the database system.

Type

string

Tags

None found

$connection

$connection : \Laravel\Database\Connection

The database connection instance for the grammar.

Type

LaravelDatabaseConnection

Inherited from
LaravelDatabaseGrammar

Tags

None found

Methods

foreign()

foreign(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for creating a foreign key.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Inherited from
LaravelDatabaseSchemaGrammarsGrammar

Tags

None found

drop()

drop(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop table command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Inherited from
LaravelDatabaseSchemaGrammarsGrammar

Tags

None found

wrap()

wrap(string  $value) : string

Wrap a value in keyword identifiers.

Parameters

string $value

Returns

string

Inherited from
LaravelDatabaseGrammar

Tags

None found

__construct()

__construct(\Laravel\Database\Connection  $connection) : void

Create a new database grammar instance.

Parameters

LaravelDatabaseConnection $connection

Inherited from
LaravelDatabaseGrammar

Tags

None found

wrap_table()

wrap_table(string  $table) : string

Wrap a table in keyword identifiers.

Parameters

string $table

Returns

string

Inherited from
LaravelDatabaseGrammar

Tags

None found

parameterize()

parameterize(array  $values) : string

Create query parameters from an array of values.

Returns "?, ?, ?", which may be used as PDO place-holders $parameters = $grammar->parameterize(array(1, 2, 3));

// Returns "?, "Taylor"" since an expression is used
$parameters = $grammar->parameterize(array(1, DB::raw('Taylor')));

Parameters

array $values

Returns

string

final
Inherited from
LaravelDatabaseGrammar

Tags

None found

parameter()

parameter(mixed  $value) : string

Get the appropriate query parameter string for a value.

// Returns a "?" PDO place-holder $value = $grammar->parameter('Taylor Otwell');

// Returns "Taylor Otwell" as the raw value of the expression
$value = $grammar->parameter(DB::raw('Taylor Otwell'));

Parameters

mixed $value

Returns

string

final
Inherited from
LaravelDatabaseGrammar

Tags

None found

columnize()

columnize(array  $columns) : string

Create a comma-delimited list of wrapped column names.

// Returns ""Taylor", "Otwell"" when the identifier is quotes $columns = $grammar->columnize(array('Taylor', 'Otwell'));

Parameters

array $columns

Returns

string

final
Inherited from
LaravelDatabaseGrammar

Tags

None found

create()

create(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : array

Generate the SQL statements for a table creation command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

array

Tags

None found

add()

add(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : array

Generate the SQL statements for a table modification command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

array

Tags

None found

primary()

primary(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for creating a primary key.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

unique()

unique(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for creating a unique index.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

fulltext()

fulltext(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for creating a full-text index.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

index()

index(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for creating a regular index.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

rename()

rename(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a rename table command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_column()

drop_column(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop column command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_primary()

drop_primary(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop primary key command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_unique()

drop_unique(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop unique key command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_fulltext()

drop_fulltext(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop full-text key command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_index()

drop_index(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop index command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_foreign()

drop_foreign(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Drop a foreign key constraint from the table.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

drop_constraint()

drop_constraint(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Drop a constraint from the table.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Inherited from
LaravelDatabaseSchemaGrammarsGrammar

Tags

None found

type()

type(\Laravel\Fluent  $column) : string

Get the appropriate data type definition for the column.

Parameters

LaravelFluent $column

Returns

string

Inherited from
LaravelDatabaseSchemaGrammarsGrammar

Tags

None found

default_value()

default_value(mixed  $value) : string

Format a value so that it can be used in SQL DEFAULT clauses.

Parameters

mixed $value

Returns

string

Inherited from
LaravelDatabaseSchemaGrammarsGrammar

Tags

None found

wrap_value()

wrap_value(string  $value) : string

Wrap a single string value in keyword identifiers.

Parameters

string $value

Returns

string

Inherited from
LaravelDatabaseGrammar

Tags

None found

columns()

columns(\Laravel\Database\Schema\Table  $table) : array

Create the individual column definitions for the table.

Parameters

LaravelDatabaseSchemaTable $table

Returns

array

Tags

None found

nullable()

nullable(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $column) : string

Get the SQL syntax for indicating if a column is nullable.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $column

Returns

string

Tags

None found

defaults()

defaults(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $column) : string

Get the SQL syntax for specifying a default value on a column.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $column

Returns

string

Tags

None found

incrementer()

incrementer(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $column) : string

Get the SQL syntax for defining an auto-incrementing column.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $column

Returns

string

Tags

None found

key()

key(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command, boolean  $unique = false) : string

Generate the SQL statement for creating a new index.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command
boolean $unique

Returns

string

Tags

None found

drop_key()

drop_key(\Laravel\Database\Schema\Table  $table, \Laravel\Fluent  $command) : string

Generate the SQL statement for a drop key command.

Parameters

LaravelDatabaseSchemaTable $table
LaravelFluent $command

Returns

string

Tags

None found

type_string()

type_string(\Laravel\Fluent  $column) : string

Generate the data-type definition for a string.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_integer()

type_integer(\Laravel\Fluent  $column) : string

Generate the data-type definition for an integer.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_float()

type_float(\Laravel\Fluent  $column) : string

Generate the data-type definition for an integer.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_decimal()

type_decimal(\Laravel\Fluent  $column) : string

Generate the data-type definition for a decimal.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_boolean()

type_boolean(\Laravel\Fluent  $column) : string

Generate the data-type definition for a boolean.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_date()

type_date(\Laravel\Fluent  $column) : string

Generate the data-type definition for a date.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_timestamp()

type_timestamp(\Laravel\Fluent  $column) : string

Generate the data-type definition for a timestamp.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_text()

type_text(\Laravel\Fluent  $column) : string

Generate the data-type definition for a text column.

Parameters

LaravelFluent $column

Returns

string

Tags

None found

type_blob()

type_blob(\Laravel\Fluent  $column) : string

Generate the data-type definition for a blob.

Parameters

LaravelFluent $column

Returns

string

Tags

None found