Schema management/reflection features for Sqlite
_convertColumn( string $column )
Convert a column definition to the abstract types.
The returned type will be a type that Cake\Database\Type can handle.
$column
array
Cake\Database\Exception
addConstraintSql( Cake\Database\Schema\Table $table )
Generate the SQL queries needed to add foreign key constraints to the table
SQLite can not properly handle adding a constraint to an existing table. This method is no-op
Cake\Database\Schema\Table
$table
array
columnSql( Cake\Database\Schema\Table $table , string $name )
Generate the SQL fragment for a single column in a table.
Cake\Database\Schema\Table
$table
$name
string
Cake\Database\Exception
constraintSql( Cake\Database\Schema\Table $table , string $name )
Generate the SQL fragments for defining table constraints.
Note integer primary keys will return ''. This is intentional as Sqlite requires that integer primary keys be defined in the column definition.
Cake\Database\Schema\Table
$table
$name
string
convertColumnDescription( Cake\Database\Schema\Table $table , array $row )
Convert field description results into abstract schema fields.
Cake\Database\Schema\Table
$table
$row
describeColumnSql
.convertForeignKeyDescription( Cake\Database\Schema\Table $table , array $row )
Convert a foreign key description into constraints on the Table object.
Cake\Database\Schema\Table
$table
$row
describeForeignKeySql
.convertIndexDescription( Cake\Database\Schema\Table $table , array $row )
Convert an index description results into abstract schema indexes or constraints.
Since SQLite does not have a way to get metadata about all indexes at once, additional queries are done here. Sqlite constraint names are not stable, and the names for constraints will not match those used to create the table. This is a limitation in Sqlite's metadata features.
Cake\Database\Schema\Table
$table
$row
describeIndexSql
.createTableSql( Cake\Database\Schema\Table $table , array $columns , array $constraints , array $indexes )
Generate the SQL to create a table.
Cake\Database\Schema\Table
$table
$columns
$constraints
$indexes
array
describeColumnSql( string $tableName , array $config )
Generate the SQL to describe a table.
$tableName
$config
array
describeForeignKeySql( string $tableName , array $config )
Generate the SQL to describe the foreign keys in a table.
$tableName
$config
array
describeIndexSql( string $tableName , array $config )
Generate the SQL to describe the indexes in a table.
$tableName
$config
array
dropConstraintSql( Cake\Database\Schema\Table $table )
Generate the SQL queries needed to drop foreign key constraints from the table
SQLite can not properly handle dropping a constraint to an existing table. This method is no-op
Cake\Database\Schema\Table
$table
array
hasSequences( )
Returns whether there is any table in this connection to SQLite containing sequences
boolean
indexSql( Cake\Database\Schema\Table $table , string $name )
Generate the SQL fragment for a single index in a table.
Cake\Database\Schema\Table
$table
$name
string
listTablesSql( array $config )
Generate the SQL to list the tables.
$config
array
truncateTableSql( Cake\Database\Schema\Table $table )
Generate the SQL to truncate a table.
Cake\Database\Schema\Table
$table
array
__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
_convertConstraintColumns( string|array $references )
Convert foreign key constraints references to a valid stringified list
$references
string
_convertOnClause( string $clause )
Convert string on clauses to the abstract ones.
$clause
string|null
_foreignOnClause( string|null $on )
Generate an ON clause for a foreign key.
$on
string
convertOptionsDescription( Cake\Database\Schema\Table $table , array $row )
Convert options data into table options.
Cake\Database\Schema\Table
$table
$row
describeOptionsSql( string $tableName , array $config )
Generate the SQL to describe table options
$tableName
$config
array
dropTableSql( Cake\Database\Schema\Table $table )
Generate the SQL to drop a table.
Cake\Database\Schema\Table
$table
array
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Database.Schema.SqliteSchema.html