PHP Class Cake\Database\Schema\SqliteSchema

Inheritance: extends Cake\Database\Schema\BaseSchema
Afficher le fichier Open project: cakephp/cakephp Class Usage Examples

Protected Properties

Свойство Type Description
$_constraintsIdMap array Array containing the foreign keys constraints names Necessary for composite foreign keys to be handled

Méthodes publiques

Méthode Description
addConstraintSql ( Table $table ) {@inheritDoc}
columnSql ( Table $table, $name ) {@inheritDoc}
constraintSql ( Table $table, $name ) {@inheritDoc}
convertColumnDescription ( Table $table, $row ) {@inheritDoc}
convertForeignKeyDescription ( Table $table, $row ) {@inheritDoc}
convertIndexDescription ( Table $table, $row ) {@inheritDoc}
createTableSql ( Table $table, $columns, $constraints, $indexes ) {@inheritDoc}
describeColumnSql ( $tableName, $config ) {@inheritDoc}
describeForeignKeySql ( $tableName, $config ) {@inheritDoc}
describeIndexSql ( $tableName, $config ) {@inheritDoc}
dropConstraintSql ( Table $table ) {@inheritDoc}
hasSequences ( ) : boolean Returns whether there is any table in this connection to SQLite containing sequences
indexSql ( Table $table, $name ) {@inheritDoc}
listTablesSql ( $config ) {@inheritDoc}
truncateTableSql ( Table $table ) {@inheritDoc}

Méthodes protégées

Méthode Description
_convertColumn ( string $column ) : array Convert a column definition to the abstract types.
_defaultValue ( string | null $default ) : string | null Manipulate the default value.

Method Details

_convertColumn() protected méthode

The returned type will be a type that Cake\Database\Type can handle.
protected _convertColumn ( string $column ) : array
$column string The column type + length
Résultat array Array of column information.

_defaultValue() protected méthode

Sqlite includes quotes and bared NULLs in default values. We need to remove those.
protected _defaultValue ( string | null $default ) : string | null
$default string | null The default value.
Résultat string | null

addConstraintSql() public méthode

SQLite can not properly handle adding a constraint to an existing table. This method is no-op
public addConstraintSql ( Table $table )
$table Table

columnSql() public méthode

{@inheritDoc}
public columnSql ( Table $table, $name )
$table Table

constraintSql() public méthode

Note integer primary keys will return ''. This is intentional as Sqlite requires that integer primary keys be defined in the column definition.
public constraintSql ( Table $table, $name )
$table Table

convertColumnDescription() public méthode

{@inheritDoc}
public convertColumnDescription ( Table $table, $row )
$table Table

convertForeignKeyDescription() public méthode

{@inheritDoc}
public convertForeignKeyDescription ( Table $table, $row )
$table Table

convertIndexDescription() public méthode

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.
public convertIndexDescription ( Table $table, $row )
$table Table

createTableSql() public méthode

{@inheritDoc}
public createTableSql ( Table $table, $columns, $constraints, $indexes )
$table Table

describeColumnSql() public méthode

{@inheritDoc}
public describeColumnSql ( $tableName, $config )

describeForeignKeySql() public méthode

{@inheritDoc}
public describeForeignKeySql ( $tableName, $config )

describeIndexSql() public méthode

{@inheritDoc}
public describeIndexSql ( $tableName, $config )

dropConstraintSql() public méthode

SQLite can not properly handle dropping a constraint to an existing table. This method is no-op
public dropConstraintSql ( Table $table )
$table Table

hasSequences() public méthode

Returns whether there is any table in this connection to SQLite containing sequences
public hasSequences ( ) : boolean
Résultat boolean

indexSql() public méthode

{@inheritDoc}
public indexSql ( Table $table, $name )
$table Table

listTablesSql() public méthode

{@inheritDoc}
public listTablesSql ( $config )

truncateTableSql() public méthode

{@inheritDoc}
public truncateTableSql ( Table $table )
$table Table

Property Details

$_constraintsIdMap protected_oe property

Array containing the foreign keys constraints names Necessary for composite foreign keys to be handled
protected array $_constraintsIdMap
Résultat array