interfaceTableConstraint
interface TableConstraint
extends Node
Public API: explicitly declared with
@visibility public.One clause of the constraint list written after the columns of a table definition.
The closed set is: a constraint name, PRIMARY KEY, UNIQUE, CHECK and FOREIGN KEY. Source: https://sqlite.org/syntax/table-constraint.html.
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a, b, UNIQUE (a, b))');
$create->statement->constraints[0]->items[0] instanceof \SqlSemantics\Platform\Sqlite\Statement\Schema\Table\TableConstraint // => trueMethods§
public function deriveConstraint(Derivation $derivation, ConstraintScope $scope): voidDerives the facts of the operands of the clause inside the table definition.
Parameters
$derivation | Derivation | |
$scope | ConstraintScope |
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Relations§
Implemented by 5
- ConstraintName packages/sql-semantics-sqlite/src/Statement/Schema/Column/ConstraintName.php:33
- ForeignKey packages/sql-semantics-sqlite/src/Statement/Schema/Table/ForeignKey.php:33
- TableCheck packages/sql-semantics-sqlite/src/Statement/Schema/Table/TableCheck.php:34
- TablePrimaryKey packages/sql-semantics-sqlite/src/Statement/Schema/Table/TablePrimaryKey.php:40
- TableUnique packages/sql-semantics-sqlite/src/Statement/Schema/Table/TableUnique.php:36