class PostgresqlGrammar extends AbstractQueryGrammar (View source)

Class PostgresqlQueryGrammar

Constants

PRIMARY

INDEX

UNIQUE

SPATIAL

FULLTEXT

FOREIGN

Properties

static Query $query Property query.

Methods

getInstance(string $name)

getInstance

static string
build()

build

static Query
getQuery(bool $new = false)

getQuery

static string
listDatabases(array|string $where = null)

showDatabases

static string
createDatabase(string $name, string $encoding = null, string $owner = null)

createDatabase

static string
dropDatabase(string $db, bool $ifExist = false)

dropTable

static string
showTableColumns(string $table)

showTableColumn

static string
showDbTables(string $dbname, string $where = null)

showDbTables

static string
createTable(string $name, array $columns, array|string $pks = array(), array $keys = array(), string $inherits = null, bool $ifNotExists = true, string $tablespace = null)

createTable

static string
dropTable(string $table, bool $ifExists = false, string $option = '')

dropTable

static string
comment(string $object = 'COLUMN', string $table, string $column, string $comment)

comment

static string
alterColumn(string $operation, string $table, string $column, string $type = null, bool $notNull = false, null $default = null)

alterColumn

static string
addColumn(string $table, string $column, string $type = 'text', bool $allowNull = false, string $default = null)

Add column

static string
renameColumn(string $table, string $oldColumn, string $newColumn)

changeColumn

static string
dropColumn(string $table, string $column)

dropColumn

static string
addIndex(string $table, string $type, array $columns, string $name)

addIndex

static string
buildIndexDeclare(string $name, array $columns, $table = null)

buildIndexDeclare

static string
dropIndex(string $name, bool $ifExists = false, bool $concurrently = false)

dropIndex

static string
dropConstraint(string $table, string $name, bool $ifExists = false, string $action = null)

dropConstraint

static string
changeColumn(string $table, string $oldColumn, string $newColumn, string $type = 'text')

changeColumn

Details

static QueryGrammarInterface getInstance(string $name)

getInstance

Parameters

string $name

Return Value

QueryGrammarInterface

at line line 481
static string build()

build

Return Value

string

at line line 507
static Query getQuery(bool $new = false)

getQuery

Parameters

bool $new

Return Value

Query

at line line 43
static string listDatabases(array|string $where = null)

showDatabases

Parameters

array|string $where

Return Value

string

at line line 61
static string createDatabase(string $name, string $encoding = null, string $owner = null)

createDatabase

Parameters

string $name
string $encoding
string $owner

Return Value

string

at line line 81
static string dropDatabase(string $db, bool $ifExist = false)

dropTable

Parameters

string $db
bool $ifExist

Return Value

string

at line line 99
static string showTableColumns(string $table)

showTableColumn

Parameters

string $table

Return Value

string

at line line 140
static string showDbTables(string $dbname, string $where = null)

showDbTables

Parameters

string $dbname
string $where

Return Value

string

at line line 171
static string createTable(string $name, array $columns, array|string $pks = array(), array $keys = array(), string $inherits = null, bool $ifNotExists = true, string $tablespace = null)

createTable

Parameters

string $name
array $columns
array|string $pks
array $keys
string $inherits
bool $ifNotExists
string $tablespace

Return Value

string

at line line 242
static string dropTable(string $table, bool $ifExists = false, string $option = '')

dropTable

Parameters

string $table
bool $ifExists
string $option

Return Value

string

at line line 264
static string comment(string $object = 'COLUMN', string $table, string $column, string $comment)

comment

Parameters

string $object
string $table
string $column
string $comment

Return Value

string

at line line 288
static string alterColumn(string $operation, string $table, string $column, string $type = null, bool $notNull = false, null $default = null)

alterColumn

Parameters

string $operation
string $table
string $column
string $type
bool $notNull
null $default

Return Value

string

at line line 316
static string addColumn(string $table, string $column, string $type = 'text', bool $allowNull = false, string $default = null)

Add column

Parameters

string $table
string $column
string $type
bool $allowNull
string $default

Return Value

string

at line line 340
static string renameColumn(string $table, string $oldColumn, string $newColumn)

changeColumn

Parameters

string $table
string $oldColumn
string $newColumn

Return Value

string

at line line 355
static string dropColumn(string $table, string $column)

dropColumn

Parameters

string $table
string $column

Return Value

string

at line line 377
static string addIndex(string $table, string $type, array $columns, string $name)

addIndex

Parameters

string $table
string $type
array $columns
string $name

Return Value

string

at line line 398
static string buildIndexDeclare(string $name, array $columns, $table = null)

buildIndexDeclare

Parameters

string $name
array $columns
$table

Return Value

string

at line line 440
static string dropIndex(string $name, bool $ifExists = false, bool $concurrently = false)

dropIndex

Parameters

string $name
bool $ifExists
bool $concurrently

Return Value

string

at line line 462
static string dropConstraint(string $table, string $name, bool $ifExists = false, string $action = null)

dropConstraint

Parameters

string $table
string $name
bool $ifExists
string $action

Return Value

string

at line line 527
static string changeColumn(string $table, string $oldColumn, string $newColumn, string $type = 'text')

changeColumn

Parameters

string $table
string $oldColumn
string $newColumn
string $type

Return Value

string