Skip to content

Kirby 3.6.6

$sqlite->createColumn()

Creates the CREATE TABLE syntax for a single column

$sqlite->createColumn(string $name, array $column): array

Parameters

Name Type Default Description
$name * string Column name
$column * array Column definition array; valid keys:
- type (required): Column template to use
- null: Whether the column may be NULL (boolean)
- key: Index this column is part of; special values 'primary' for PRIMARY KEY and true for automatic naming
- unique: Whether the index (or if not set the column itself) has a UNIQUE constraint
- default: Default value of this column

Return type

array

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException if no column type is given or the column type is not supported.

Parent class

Kirby\Database\Sql\Sqlite inherited from Kirby\Database\Sql