Craft 3 Class Reference

Class craft\db\pgsql\Schema

Inheritance
craft\db\pgsql\Schema » yii\db\pgsql\Schema » yii\db\Schema » yii\base\BaseObject
Implements
yii\base\Configurable, yii\db\ConstraintFinderInterface
Uses Traits
yii\db\ConstraintFinderTrait, yii\db\ViewFinderTrait
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/db/pgsql/Schema.php

Public Properties
Property Type Description Defined By
$columnSchemaClass {@inheritdoc} yii\db\pgsql\Schema
$db yii\db\Connection The database connection yii\db\Schema
$defaultSchema string The default schema used for the current session. yii\db\pgsql\Schema
$exceptionMap array Map of DB errors and corresponding exceptions If left part is found in DB error message exception class from the right part is used. yii\db\Schema
$maxObjectNameLength integer The maximum length that objects' names can be. craft\db\pgsql\Schema
$typeMap array Mapping from physical column types (keys) to abstract column types (values) yii\db\pgsql\Schema
Protected Properties
Property Type Description Defined By
$columnQuoteCharacter string, string[] Character used to quote column names. yii\db\Schema
$tableQuoteCharacter {@inheritdoc} yii\db\pgsql\Schema
Public Methods
Method Description Defined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__unset() Sets an object property to null. yii\base\BaseObject
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
convertException() Converts a DB exception to a more concrete one if possible. yii\db\Schema
createColumnSchemaBuilder() Create a column schema builder instance giving the type and value precision. yii\db\Schema
createQueryBuilder() Creates a query builder for the database. craft\db\pgsql\Schema
createSavepoint() Creates a new savepoint. yii\db\Schema
findIndexes() Returns all indexes for the given table. Each array element is of the following structure: craft\db\pgsql\Schema
findUniqueIndexes() Returns all unique indexes for the given table. yii\db\pgsql\Schema
getDefaultBackupCommand() Returns the default backup command to execute. craft\db\pgsql\Schema
getDefaultRestoreCommand() Returns the default database restore command to execute. craft\db\pgsql\Schema
getLastInsertID() Returns the ID of the last inserted row or sequence value. craft\db\pgsql\Schema
getPdoType() Determines the PDO type for the given PHP data value. yii\db\Schema
getQueryBuilder() yii\db\Schema
getRawTableName() Returns the actual name of a given table name. yii\db\Schema
getSchemaChecks() Returns check constraints for all tables in the database. yii\db\ConstraintFinderTrait
getSchemaDefaultValues() Returns default value constraints for all tables in the database. yii\db\ConstraintFinderTrait
getSchemaForeignKeys() Returns foreign keys for all tables in the database. yii\db\ConstraintFinderTrait
getSchemaIndexes() Returns indexes for all tables in the database. yii\db\ConstraintFinderTrait
getSchemaNames() Returns all schema names in the database, except system schemas. yii\db\Schema
getSchemaPrimaryKeys() Returns primary keys for all tables in the database. yii\db\ConstraintFinderTrait
getSchemaUniques() Returns unique constraints for all tables in the database. yii\db\ConstraintFinderTrait
getServerVersion() Returns a server version as a string comparable by \version_compare(). yii\db\Schema
getTableChecks() Obtains the check constraints information for the named table. yii\db\ConstraintFinderTrait
getTableDefaultValues() Obtains the default value constraints information for the named table. yii\db\ConstraintFinderTrait
getTableForeignKeys() Obtains the foreign keys information for the named table. yii\db\ConstraintFinderTrait
getTableIndexes() Obtains the indexes information for the named table. yii\db\ConstraintFinderTrait
getTableNames() Returns all table names in the database. yii\db\Schema
getTablePrimaryKey() Obtains the primary key for the named table. yii\db\ConstraintFinderTrait
getTableSchema() Obtains the metadata for the named table. yii\db\Schema
getTableSchemas() Returns the metadata for all tables in the database. yii\db\Schema
getTableUniques() Obtains the unique constraints information for the named table. yii\db\ConstraintFinderTrait
getViewNames() Returns all view names in the database. yii\db\ViewFinderTrait
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. yii\base\BaseObject
insert() {@inheritdoc} yii\db\pgsql\Schema
isReadQuery() Returns a value indicating whether a SQL statement is for read purpose. yii\db\Schema
loadTableSchema() Loads the metadata for the specified table. craft\db\pgsql\Schema
quoteColumnName() Quotes a column name for use in a query. yii\db\Schema
quoteDatabaseName() Quotes a database name for use in a query. craft\db\pgsql\Schema
quoteSimpleColumnName() Quotes a simple column name for use in a query. yii\db\Schema
quoteSimpleTableName() Quotes a simple table name for use in a query. yii\db\Schema
quoteTableName() Quotes a table name for use in a query. yii\db\Schema
quoteValue() Quotes a string value for use in a query. yii\db\Schema
refresh() Refreshes the schema. yii\db\Schema
refreshTableSchema() Refreshes the particular table schema. yii\db\Schema
releaseSavepoint() Releases an existing savepoint. craft\db\pgsql\Schema
rollBackSavepoint() Rolls back to a previously created savepoint. craft\db\pgsql\Schema
setTransactionIsolationLevel() Sets the isolation level of the current transaction. yii\db\Schema
supportsSavepoint() yii\db\Schema
unquoteSimpleColumnName() Unquotes a simple column name. yii\db\Schema
unquoteSimpleTableName() Unquotes a simple table name. yii\db\Schema
Protected Methods
Method Description Defined By
createColumnSchema() Creates a column schema for the database. yii\db\Schema
findColumns() Collects the metadata of table columns. yii\db\pgsql\Schema
findConstraints() Collects extra foreign key information details for the given table. craft\db\pgsql\Schema
findSchemaNames() {@inheritdoc} yii\db\pgsql\Schema
findTableNames() {@inheritdoc} yii\db\pgsql\Schema
findViewNames() Returns all views names in the database. yii\db\ViewFinderTrait
getCacheKey() Returns the cache key for the specified table name. yii\db\Schema
getCacheTag() Returns the cache tag name. yii\db\Schema
getColumnPhpType() Extracts the PHP type from abstract DB type. yii\db\Schema
getIndexInformation() Gets information about given table indexes. craft\db\pgsql\Schema
getSchemaMetadata() Returns the metadata of the given type for all tables in the given schema. yii\db\ConstraintFinderTrait
getTableMetadata() Returns the metadata of the given type for the given table. yii\db\ConstraintFinderTrait
getUniqueIndexInformation() Gets information about given table unique indexes. yii\db\pgsql\Schema
loadColumnSchema() Loads the column information into a yii\db\pgsql\ColumnSchema object. yii\db\pgsql\Schema
loadTableChecks() Loads all check constraints for the given table. yii\db\ConstraintFinderTrait
loadTableDefaultValues() Loads all default value constraints for the given table. yii\db\ConstraintFinderTrait
loadTableForeignKeys() Loads all foreign keys for the given table. yii\db\ConstraintFinderTrait
loadTableIndexes() Loads all indexes for the given table. yii\db\ConstraintFinderTrait
loadTablePrimaryKey() Loads a primary key for the given table. yii\db\ConstraintFinderTrait
loadTableUniques() Loads all unique constraints for the given table. yii\db\ConstraintFinderTrait
normalizePdoRowKeyCase() Changes row's array key case to lower if PDO's one is set to uppercase. yii\db\Schema
resolveTableName() {@inheritdoc} yii\db\pgsql\Schema
resolveTableNames() Resolves the table name and schema name (if any). yii\db\pgsql\Schema
setTableMetadata() Sets the metadata of the given type for the given table. yii\db\Schema
Constants
Constant Value Description Defined By
SCHEMA_CACHE_VERSION 1 Schema cache version, to detect incompatibilities in cached values when the data format of the cache changes. yii\db\Schema
TYPE_BIGINT 'bigint' yii\db\Schema
TYPE_BIGPK 'bigpk' yii\db\Schema
TYPE_BINARY 'binary' yii\db\Schema
TYPE_BOOLEAN 'boolean' yii\db\Schema
TYPE_CHAR 'char' yii\db\Schema
TYPE_DATE 'date' yii\db\Schema
TYPE_DATETIME 'datetime' yii\db\Schema
TYPE_DECIMAL 'decimal' yii\db\Schema
TYPE_DOUBLE 'double' yii\db\Schema
TYPE_FLOAT 'float' yii\db\Schema
TYPE_INTEGER 'integer' yii\db\Schema
TYPE_JSON 'json' yii\db\Schema
TYPE_JSONB 'jsonb' yii\db\pgsql\Schema
TYPE_MONEY 'money' yii\db\Schema
TYPE_PK 'pk' yii\db\Schema
TYPE_SMALLINT 'smallint' yii\db\Schema
TYPE_STRING 'string' yii\db\Schema
TYPE_TEXT 'text' yii\db\Schema
TYPE_TIME 'time' yii\db\Schema
TYPE_TIMESTAMP 'timestamp' yii\db\Schema
TYPE_TINYINT 'tinyint' yii\db\Schema
TYPE_UBIGPK 'ubigpk' yii\db\Schema
TYPE_UPK 'upk' yii\db\Schema

Property Details

$maxObjectNameLength public property #

The maximum length that objects' names can be.

public integer $maxObjectNameLength 63

Method Details

createQueryBuilder() public method #

Creates a query builder for the database.

This method may be overridden by child classes to create a DBMS-specific query builder.

public craft\db\pgsql\QueryBuilder createQueryBuilder ( )
return craft\db\pgsql\QueryBuilder Query builder instance

findConstraints() protected method #

Collects extra foreign key information details for the given table.

protected void findConstraints ( $table )
$table craft\db\TableSchema The table metadata

findIndexes() public method #

Returns all indexes for the given table. Each array element is of the following structure:

[
    'IndexName1' => ['col1' [, ...]],
    'IndexName2' => ['col2' [, ...]],
]
public array findIndexes ( \craft\db\pgsql\string $tableName )
$tableName string The name of the table to get the indexes for.
return array All indexes for the given table.

getDefaultBackupCommand() public method #

Returns the default backup command to execute.

public string, false getDefaultBackupCommand ( )
return string, false The command to execute

getDefaultRestoreCommand() public method #

Returns the default database restore command to execute.

public string getDefaultRestoreCommand ( )
return string The command to execute

getIndexInformation() protected method #

Gets information about given table indexes.

protected array getIndexInformation ( craft\db\TableSchema $table )
$table craft\db\TableSchema The table metadata
return array Index and column names

getLastInsertID() public method #

Returns the ID of the last inserted row or sequence value.

public string getLastInsertID ( $sequenceName '' )
$sequenceName string Name of the sequence object (required by some DBMS)
return string The row ID of the last row inserted, or the last value retrieved from the sequence object
throws yii\base\InvalidCallException if the DB connection is not active

loadTableSchema() public method #

Loads the metadata for the specified table.

public craft\db\TableSchema, null loadTableSchema ( $name )
$name string Table name
return craft\db\TableSchema, null Driver dependent table metadata. Null if the table does not exist.

quoteDatabaseName() public method #

Quotes a database name for use in a query.

public string quoteDatabaseName ( \craft\db\pgsql\string $name )
$name string

releaseSavepoint() public method #

Releases an existing savepoint.

public void releaseSavepoint ( $name )
$name string The savepoint name.
throws yii\db\Exception

rollBackSavepoint() public method #

Rolls back to a previously created savepoint.

public void rollBackSavepoint ( $name )
$name string The savepoint name.
throws yii\db\Exception