class SQLGenerator (View source)

Traits

Methods

SQLGenerator
addFloat(string $column, array $attribute = [])

Add float column

SQLGenerator
addDouble(string $column, array $attribute = [])

Add double column

SQLGenerator
addDoublePrimary(string $column)

Add double primary column

SQLGenerator
addFloatPrimary(string $column)

Add float primary column

SQLGenerator
addIncrement(string $column)

Add increment primary column

SQLGenerator
addInteger(string $column, array $attribute = [])

Add integer column

SQLGenerator
addIntegerPrimary(string $column)

Add integer primary column

SQLGenerator
addBigIncrement(string $column)

Add big increment primary column

SQLGenerator
addTinyInteger(string $column, array $attribute = [])

Add tiny integer column

SQLGenerator
addBigInteger(string $column, array $attribute = [])

Add Big integer column

SQLGenerator
addMediumInteger(string $column, array $attribute = [])

Add Medium integer column

SQLGenerator
addMediumIncrement(string $column)

Add Medium integer column

SQLGenerator
changeFloat(string $column, array $attribute = [])

Change float column

SQLGenerator
changeDouble(string $column, array $attribute = [])

Change double column

SQLGenerator
changeDoublePrimary(string $column)

Change double primary column

SQLGenerator
changeFloatPrimary(string $column)

Change float primary column

SQLGenerator
changeIncrement(string $column)

Change increment primary column

SQLGenerator
changeInteger(string $column, array $attribute = [])

Change integer column

SQLGenerator
changeIntegerPrimary(string $column)

Change integer primary column

SQLGenerator
changeBigIncrement(string $column)

Change big increment primary column

SQLGenerator
changeTinyInteger(string $column, array $attribute = [])

Change tiny integer column

SQLGenerator
changeBigInteger(string $column, array $attribute = [])

Change Big integer column

SQLGenerator
changeMediumInteger(string $column, array $attribute = [])

Change Medium integer column

SQLGenerator
changeMediumIncrement(string $column)

Change Medium integer column

SQLGenerator
addBoolean(string $column, array $attribute = [])

Add boolean column

SQLGenerator
addUuid(string $column, array $attribute = [])

Add UUID column

SQLGenerator
addBinary(string $column, array $attribute = [])

Add BLOB column

SQLGenerator
addIpAddress(string $column, array $attribute = [])

Add ip column

SQLGenerator
addMacAddress(string $column, array $attribute = [])

Add mac column

SQLGenerator
addEnum(string $column, array $attribute = [])

Add enum column

SQLGenerator
changeBoolean(string $column, array $attribute = [])

Change boolean column

SQLGenerator
changeUuid(string $column, array $attribute = [])

Change UUID column

SQLGenerator
changeBinary(string $column, array $attribute = [])

Change BLOB column

SQLGenerator
changeIpAddress(string $column, array $attribute = [])

Change ip column

SQLGenerator
changeMacAddress(string $column, array $attribute = [])

Change mac column

SQLGenerator
changeEnum(string $column, array $attribute = [])

Change enum column

SQLGenerator
addString(string $column, array $attribute = [])

Add string column

SQLGenerator
addLongString(string $column, array $attribute = [])

Add string column

SQLGenerator
addJson(string $column, array $attribute = [])

Add json column

SQLGenerator
addChar(string $column, array $attribute = [])

Add character column

SQLGenerator
addLongtext(string $column, array $attribute = [])

Add longtext column

SQLGenerator
addText(string $column, array $attribute = [])

Add text column

SQLGenerator
addBlob(string $column, array $attribute = [])

Add blob column

SQLGenerator
changeString(string $column, array $attribute = [])

Change string column

SQLGenerator
changeLongString(string $column, array $attribute = [])

Change string column

SQLGenerator
changeJson(string $column, array $attribute = [])

Change json column

SQLGenerator
changeChar(string $column, array $attribute = [])

Change character column

SQLGenerator
changeLongtext(string $column, array $attribute = [])

Change longtext column

SQLGenerator
changeText(string $column, array $attribute = [])

Change text column

SQLGenerator
changeBlob(string $column, array $attribute = [])

Change blob column

SQLGenerator
addDatetime(string $column, array $attribute = [])

Add datetime column

SQLGenerator
addDate(string $column, array $attribute = [])

Add date column

SQLGenerator
addTime(string $column, array $attribute = [])

Add time column

SQLGenerator
addYear(string $column, array $attribute = [])

Add year column

SQLGenerator
addTimestamp(string $column, array $attribute = [])

Add timestamp column

SQLGenerator
addTimestamps()

Add default timestamps

SQLGenerator
changeDatetime(string $column, array $attribute = [])

Change datetime column

SQLGenerator
changeDate(string $column, array $attribute = [])

Change date column

SQLGenerator
changeTime(string $column, array $attribute = [])

Change time column

SQLGenerator
changeYear(string $column, array $attribute = [])

Change year column

SQLGenerator
changeTimestamp(string $column, array $attribute = [])

Change timestamp column

SQLGenerator
changeTimestamps()

Change default timestamps

SQLGenerator
addForeign(string $name, array $attributes = [])

Add Foreign KEY constraints

SQLGenerator
dropForeign(string $name, bool $as_raw = false)

Drop constraintes column;

SQLGenerator
addIndex(string $name)

Add table index;

SQLGenerator
dropIndex(string $name)

Drop table index;

SQLGenerator
dropPrimary()

Drop primary column;

SQLGenerator
addUnique(string $name)

Add table unique;

SQLGenerator
dropUnique(string $name)

Drop table unique;

__construct(string $table, string $adapter = 'mysql', string $scope = 'create')

SQLGenerator constructor

string
make()

Generate the sql

addColumn(string $name, string $type, array $attributes = [])

Add new column in the table

changeColumn(string $name, string $type, array $attributes = [])

Change a column in the table

renameColumn(string $name, string $new)

Rename a column in the table

dropColumn(string $name)

Drop table column

void
withEngine(string $engine)

Set the engine

string
getEngine()

Get the engine

void
withCollation(string $collation)

Set the collation

string
getCollation()

Get the collation

void
withCharset(string $charset)

Set the charset

string
getCharset()

Get the charset

string
getTable()

Get the define table name

setScope(string $scope)

Set the scope

setAdapter(string $adapter)

Set the adapter

Details

SQLGenerator addFloat(string $column, array $attribute = [])

Add float column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addDouble(string $column, array $attribute = [])

Add double column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addDoublePrimary(string $column)

Add double primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addFloatPrimary(string $column)

Add float primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addIncrement(string $column)

Add increment primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addInteger(string $column, array $attribute = [])

Add integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addIntegerPrimary(string $column)

Add integer primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addBigIncrement(string $column)

Add big increment primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addTinyInteger(string $column, array $attribute = [])

Add tiny integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addBigInteger(string $column, array $attribute = [])

Add Big integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addMediumInteger(string $column, array $attribute = [])

Add Medium integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addMediumIncrement(string $column)

Add Medium integer column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeFloat(string $column, array $attribute = [])

Change float column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeDouble(string $column, array $attribute = [])

Change double column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeDoublePrimary(string $column)

Change double primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeFloatPrimary(string $column)

Change float primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeIncrement(string $column)

Change increment primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeInteger(string $column, array $attribute = [])

Change integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeIntegerPrimary(string $column)

Change integer primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeBigIncrement(string $column)

Change big increment primary column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator changeTinyInteger(string $column, array $attribute = [])

Change tiny integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeBigInteger(string $column, array $attribute = [])

Change Big integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeMediumInteger(string $column, array $attribute = [])

Change Medium integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeMediumIncrement(string $column)

Change Medium integer column

Parameters

string $column

Return Value

SQLGenerator

SQLGenerator addBoolean(string $column, array $attribute = [])

Add boolean column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addUuid(string $column, array $attribute = [])

Add UUID column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addBinary(string $column, array $attribute = [])

Add BLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addIpAddress(string $column, array $attribute = [])

Add ip column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addMacAddress(string $column, array $attribute = [])

Add mac column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addEnum(string $column, array $attribute = [])

Add enum column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeBoolean(string $column, array $attribute = [])

Change boolean column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeUuid(string $column, array $attribute = [])

Change UUID column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeBinary(string $column, array $attribute = [])

Change BLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeIpAddress(string $column, array $attribute = [])

Change ip column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeMacAddress(string $column, array $attribute = [])

Change mac column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeEnum(string $column, array $attribute = [])

Change enum column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addString(string $column, array $attribute = [])

Add string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addLongString(string $column, array $attribute = [])

Add string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addJson(string $column, array $attribute = [])

Add json column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addChar(string $column, array $attribute = [])

Add character column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addLongtext(string $column, array $attribute = [])

Add longtext column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addText(string $column, array $attribute = [])

Add text column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addBlob(string $column, array $attribute = [])

Add blob column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeString(string $column, array $attribute = [])

Change string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeLongString(string $column, array $attribute = [])

Change string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeJson(string $column, array $attribute = [])

Change json column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeChar(string $column, array $attribute = [])

Change character column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeLongtext(string $column, array $attribute = [])

Change longtext column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeText(string $column, array $attribute = [])

Change text column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeBlob(string $column, array $attribute = [])

Change blob column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addDatetime(string $column, array $attribute = [])

Add datetime column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addDate(string $column, array $attribute = [])

Add date column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addTime(string $column, array $attribute = [])

Add time column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addYear(string $column, array $attribute = [])

Add year column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addTimestamp(string $column, array $attribute = [])

Add timestamp column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator addTimestamps()

Add default timestamps

Return Value

SQLGenerator

SQLGenerator changeDatetime(string $column, array $attribute = [])

Change datetime column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeDate(string $column, array $attribute = [])

Change date column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeTime(string $column, array $attribute = [])

Change time column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeYear(string $column, array $attribute = [])

Change year column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeTimestamp(string $column, array $attribute = [])

Change timestamp column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

SQLGenerator changeTimestamps()

Change default timestamps

Return Value

SQLGenerator

SQLGenerator addForeign(string $name, array $attributes = [])

Add Foreign KEY constraints

Parameters

string $name
array $attributes

Return Value

SQLGenerator

SQLGenerator dropForeign(string $name, bool $as_raw = false)

Drop constraintes column;

Parameters

string $name
bool $as_raw

Return Value

SQLGenerator

SQLGenerator addIndex(string $name)

Add table index;

Parameters

string $name

Return Value

SQLGenerator

SQLGenerator dropIndex(string $name)

Drop table index;

Parameters

string $name

Return Value

SQLGenerator

SQLGenerator dropPrimary()

Drop primary column;

Return Value

SQLGenerator

SQLGenerator addUnique(string $name)

Add table unique;

Parameters

string $name

Return Value

SQLGenerator

SQLGenerator dropUnique(string $name)

Drop table unique;

Parameters

string $name

Return Value

SQLGenerator

__construct(string $table, string $adapter = 'mysql', string $scope = 'create')

SQLGenerator constructor

Parameters

string $table
string $adapter
string $scope

string make()

Generate the sql

Return Value

string

SQLGenerator addColumn(string $name, string $type, array $attributes = [])

Add new column in the table

Parameters

string $name
string $type
array $attributes

Return Value

SQLGenerator

SQLGenerator changeColumn(string $name, string $type, array $attributes = [])

Change a column in the table

Parameters

string $name
string $type
array $attributes

Return Value

SQLGenerator

SQLGenerator renameColumn(string $name, string $new)

Rename a column in the table

Parameters

string $name
string $new

Return Value

SQLGenerator

SQLGenerator dropColumn(string $name)

Drop table column

Parameters

string $name

Return Value

SQLGenerator

void withEngine(string $engine)

Set the engine

Parameters

string $engine

Return Value

void

string getEngine()

Get the engine

Return Value

string

void withCollation(string $collation)

Set the collation

Parameters

string $collation

Return Value

void

string getCollation()

Get the collation

Return Value

string

void withCharset(string $charset)

Set the charset

Parameters

string $charset

Return Value

void

string getCharset()

Get the charset

Return Value

string

string getTable()

Get the define table name

Return Value

string

SQLGenerator setScope(string $scope)

Set the scope

Parameters

string $scope

Return Value

SQLGenerator

SQLGenerator setAdapter(string $adapter)

Set the adapter

Parameters

string $adapter

Return Value

SQLGenerator