$_driver
$_driver : \Cake\Database\Driver
The driver instance being used.
Base class for schema implementations.
This class contains methods that are common across the various SQL dialects.
$_driver : \Cake\Database\Driver
The driver instance being used.
__construct(\Cake\Database\Driver $driver)
Constructor
This constructor will connect the driver so that methods like columnSql() and others will fail when the driver has not been connected.
\Cake\Database\Driver | $driver | The driver to use. |
dropTableSql(\Cake\Database\Schema\TableSchema $schema) : array
Generate the SQL to drop a table.
\Cake\Database\Schema\TableSchema | $schema | Schema instance |
SQL statements to drop a table.
describeForeignKeySql(string $tableName, array $config) : array
Generate the SQL to describe the foreign keys in a table.
string | $tableName | The table name to get information on. |
array | $config | The connection configuration. |
An array of (sql, params) to execute.
convertColumnDescription(\Cake\Database\Schema\TableSchema $schema, array $row) : void
Convert field description results into abstract schema fields.
\Cake\Database\Schema\TableSchema | $schema | The table object to append fields to. |
array | $row | The row data from |
convertIndexDescription(\Cake\Database\Schema\TableSchema $schema, array $row) : void
Convert an index description results into abstract schema indexes or constraints.
\Cake\Database\Schema\TableSchema | $schema | The table object to append an index or constraint to. |
array | $row | The row data from |
convertForeignKeyDescription(\Cake\Database\Schema\TableSchema $schema, array $row) : void
Convert a foreign key description into constraints on the Table object.
\Cake\Database\Schema\TableSchema | $schema | The table object to append a constraint to. |
array | $row | The row data from |
convertOptionsDescription(\Cake\Database\Schema\TableSchema $schema, array $row) : void
Convert options data into table options.
\Cake\Database\Schema\TableSchema | $schema | Table instance. |
array | $row | The row of data. |
createTableSql(\Cake\Database\Schema\TableSchema $schema, array $columns, array $constraints, array $indexes) : array
Generate the SQL to create a table.
\Cake\Database\Schema\TableSchema | $schema | Table instance. |
array | $columns | The columns to go inside the table. |
array | $constraints | The constraints for the table. |
array | $indexes | The indexes for the table. |
SQL statements to create a table.
columnSql(\Cake\Database\Schema\TableSchema $schema, string $name) : string
Generate the SQL fragment for a single column in a table.
\Cake\Database\Schema\TableSchema | $schema | The table instance the column is in. |
string | $name | The name of the column. |
SQL fragment.
addConstraintSql(\Cake\Database\Schema\TableSchema $schema) : array
Generate the SQL queries needed to add foreign key constraints to the table
\Cake\Database\Schema\TableSchema | $schema | The table instance the foreign key constraints are. |
SQL fragment.
dropConstraintSql(\Cake\Database\Schema\TableSchema $schema) : array
Generate the SQL queries needed to drop foreign key constraints from the table
\Cake\Database\Schema\TableSchema | $schema | The table instance the foreign key constraints are. |
SQL fragment.
constraintSql(\Cake\Database\Schema\TableSchema $schema, string $name) : string
Generate the SQL fragments for defining table constraints.
\Cake\Database\Schema\TableSchema | $schema | The table instance the column is in. |
string | $name | The name of the column. |
SQL fragment.
indexSql(\Cake\Database\Schema\TableSchema $schema, string $name) : string
Generate the SQL fragment for a single index in a table.
\Cake\Database\Schema\TableSchema | $schema | The table object the column is in. |
string | $name | The name of the column. |
SQL fragment.
truncateTableSql(\Cake\Database\Schema\TableSchema $schema) : array
Generate the SQL to truncate a table.
\Cake\Database\Schema\TableSchema | $schema | Table instance. |
SQL statements to truncate a table.