class SQLGenerator (View source)

Traits

Properties

protected array $custom_types

Define the query for create the custom type

from  PgsqlCompose

Methods

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

Add float column

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

Add double column

addDoublePrimary(string $column)

Add double primary column

addFloatPrimary(string $column)

Add float primary column

addIncrement(string $column)

Add increment primary column

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

Add integer column

addIntegerPrimary(string $column)

Add integer primary column

addBigIncrement(string $column)

Add big increment primary column

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

Add tiny integer column

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

Add Big integer column

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

Add Medium integer column

addMediumIncrement(string $column)

Add Medium integer column

addSmallInteger(string $column, array $attribute = [])

Add small integer column

addSmallIntegerIncrement(string $column)

Add Smallint integer column

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

Change float column

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

Change double column

changeDoublePrimary(string $column)

Change double primary column

changeFloatPrimary(string $column)

Change float primary column

changeIncrement(string $column)

Change increment primary column

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

Change integer column

changeIntegerPrimary(string $column)

Change integer primary column

changeBigIncrement(string $column)

Change big increment primary column

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

Change tiny integer column

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

Change Big integer column

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

Change Medium integer column

changeMediumIncrement(string $column)

Change Medium integer column

changeSmallInteger(string $column, array $attribute = [])

Change Small integer column

changeSmallIntegerPrimary(string $column)

Change Small integer column

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

Add BOOLEAN column

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

Add UUID column

addUuidPrimary(string $column, array $attribute = [])

Add UUID column

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

Add BINARY column

addTinyBlob(string $column, array $attribute = [])

Add TINYBLOB column

addLongBlob(string $column, array $attribute = [])

Add LONGBLOB column

addMediumBlob(string $column, array $attribute = [])

Add MEDIUMBLOB column

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

Add ip column

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

Add mac column

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

Add enum column

addCheck(string $column, array $attribute = [])

Add check column

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

Change boolean column

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

Change UUID column

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

Change BLOB column

changeLongBlob(string $column, array $attribute = [])

Change TINYBLOB column

changeMediumBlob(string $column, array $attribute = [])

Change MEDIUMBLOB column

changeTinyBlob(string $column, array $attribute = [])

Change TINYBLOB column

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

Change ip column

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

Change mac column

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

Change enum column

changeCheck(string $column, array $attribute = [])

Change check column

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

Add string column

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

Add json column

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

Add character column

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

Add longtext column

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

Add text column

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

Add blob column

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

Change string column

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

Change json column

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

Change character column

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

Change longtext column

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

Change text column

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

Change blob column

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

Add datetime column

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

Add date column

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

Add time column

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

Add year column

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

Add timestamp column

addTimestamps()

Add default timestamps

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

Change datetime column

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

Change date column

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

Change time column

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

Change year column

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

Change timestamp column

changeTimestamps()

Change default timestamps

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

Add Foreign KEY constraints

dropForeign(string|array $name, bool $as_raw = false)

Drop constraints column;

addIndex(string $name)

Add table index;

dropIndex(string $name)

Drop table index;

dropPrimary()

Drop primary column;

addUnique(string $name)

Add table unique;

dropUnique(string $name)

Drop table unique;

array
getCustomTypeQueries()

Get the custom type for pgsql

__construct(string $table, string $adapter, string $scope)

SQLGenerator constructor

string
make()

Generate the sql

addRaw(string $definition)

Add a raw column definition

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

Add new column in the table

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

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

string
setTable(string $table)

Set the define table name

setScope(string $scope)

Set the scope

setAdapter(string $adapter)

Set the adapter

string
normalizeOfType(string $type)

Normalize the data type

Details

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

Add float column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add double column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addDoublePrimary(string $column)

Add double primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addFloatPrimary(string $column)

Add float primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addIncrement(string $column)

Add increment primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addIntegerPrimary(string $column)

Add integer primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addBigIncrement(string $column)

Add big increment primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add tiny integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add Big integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add Medium integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addMediumIncrement(string $column)

Add Medium integer column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add small integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addSmallIntegerIncrement(string $column)

Add Smallint integer column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change float column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change double column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeDoublePrimary(string $column)

Change double primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeFloatPrimary(string $column)

Change float primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeIncrement(string $column)

Change increment primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeIntegerPrimary(string $column)

Change integer primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeBigIncrement(string $column)

Change big increment primary column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change tiny integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change Big integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change Medium integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeMediumIncrement(string $column)

Change Medium integer column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change Small integer column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeSmallIntegerPrimary(string $column)

Change Small integer column

Parameters

string $column

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add BOOLEAN column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add UUID column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add UUID column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add BINARY column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add TINYBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add LONGBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add MEDIUMBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add ip column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add mac column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add enum column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add check column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change boolean column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change UUID column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change BLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change TINYBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change MEDIUMBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change TINYBLOB column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change ip column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change mac column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change enum column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change check column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add json column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add character column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add longtext column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add text column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add blob column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change string column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change json column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change character column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change longtext column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change text column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change blob column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add datetime column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add date column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add time column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add year column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add timestamp column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator addTimestamps()

Add default timestamps

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change datetime column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change date column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change time column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change year column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change timestamp column

Parameters

string $column
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

SQLGenerator changeTimestamps()

Change default timestamps

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Add Foreign KEY constraints

Parameters

string $name
array $attributes

Return Value

SQLGenerator

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

Drop constraints column;

Parameters

string|array $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

array getCustomTypeQueries()

Get the custom type for pgsql

Return Value

array

__construct(string $table, string $adapter, string $scope)

SQLGenerator constructor

Parameters

string $table
string $adapter
string $scope

string make()

Generate the sql

Return Value

string

SQLGenerator addRaw(string $definition)

Add a raw column definition

Parameters

string $definition

Return Value

SQLGenerator

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

Add new column in the table

Parameters

string $name
string $type
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

Change a column in the table

Parameters

string $name
string $type
array $attribute

Return Value

SQLGenerator

Exceptions

SQLGeneratorException

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

string setTable(string $table)

Set the define table name

Parameters

string $table

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

string normalizeOfType(string $type)

Normalize the data type

Parameters

string $type

Return Value

string