classTableConstraints
final class TableConstraints
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.
Tells which values are table constraints, and checks the element lists of typed tables and partitions.
Rule: PG-TABLE-CONSTRAINTS-001. A table constraint is one of the ConstraintElem forms: CHECK, UNIQUE, PRIMARY KEY (with columns or USING INDEX), EXCLUDE and FOREIGN KEY. The elements of a typed table or a partition are column options and table constraints. Source: https://www.postgresql.org/docs/17/sql-createtable.html. Status: Implemented.
Methods§
public function admits(object $value): boolTells whether a value is a table constraint.
Parameters
$value | object |
Returns
boolTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\TableConstraints::typedElements() packages/sql-semantics-postgres/src/Rules/Table/Definition/TableConstraints.php:53
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\AddConstraint::__construct() packages/sql-semantics-postgres/src/Statement/Table/Alter/AddConstraint.php:35
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ListedColumns::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/ListedColumns.php:48
Calls 2
- function-call
in_arrayline 40 - class-const TableConstraints::CLASSES() line 40
public function typedElements(array<array-key, object|scalar|null> $elements): list<Clause>Checks the elements of a typed table or a partition.
Parameters
$elements | array<array-key, object|scalar|null> |
Returns
list<Clause>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\PartitionOf::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/PartitionOf.php:44
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\TypedTable::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/TypedTable.php:42
Calls 4
- static-call Check::listOf() line 52
- class-const Clause::class() line 52
- static-call Check::input() line 53
- method-call TableConstraints::admits() line 53
Private surface 1§
Implementation details, listed for orientation only.
private const CLASSES = [\SqlSemantics\Platform\PostgreSql\Statement\Constraint\Table\TableCheck::class…Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\AddConstraint::__construct() packages/sql-semantics-postgres/src/Statement/Table/Alter/AddConstraint.php:35
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ListedColumns::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/ListedColumns.php:48
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Element\PartitionOf::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/PartitionOf.php:44
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Element\TypedTable::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/TypedTable.php:42
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\AddConstraint::__construct() packages/sql-semantics-postgres/src/Statement/Table/Alter/AddConstraint.php:35
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ListedColumns::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/ListedColumns.php:48
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\PartitionOf::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/PartitionOf.php:44
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\TypedTable::__construct() packages/sql-semantics-postgres/src/Statement/Table/Element/TypedTable.php:42