enumConstraintAttribute
enum ConstraintAttribute: string
implements Clause
Public API: explicitly declared with
@visibility public.A property written after a constraint: whether it can be deferred, when it is checked, and whether it is validated or inherited.
Mirrors the CONSTR_ATTR_* values of PostgreSQL's Constraint node and the CAS_* bits of ConstraintAttributeSpec. NOT DEFERRABLE and INITIALLY IMMEDIATE are the defaults; a written default is kept as written. Source: https://www.postgresql.org/docs/17/sql-createtable.html.
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a int, UNIQUE (a) DEFERRABLE INITIALLY DEFERRED)');
$create->statement->definition->elements[1]->attributes // => [\SqlSemantics\Platform\PostgreSql\Statement\Constraint\ConstraintAttribute::Deferrable, \SqlSemantics\Platform\PostgreSql\Statement\Constraint\ConstraintAttribute::InitiallyDeferred]Cases§
case Deferrable = 'DEFERRABLE'case NotDeferrable = 'NOT DEFERRABLE'case InitiallyDeferred = 'INITIALLY DEFERRED'case InitiallyImmediate = 'INITIALLY IMMEDIATE'case NotValid = 'NOT VALID'case NoInherit = 'NO INHERIT'Methods§
public function deferral(): boolTells whether the attribute can be written after a column constraint, where only the deferral attributes are allowed.
Returns
boolCalls 6
- class-const ConstraintAttribute::Deferrable() line 40
- class-const ConstraintAttribute::NotDeferrable() line 40
- class-const ConstraintAttribute::InitiallyDeferred() line 40
- class-const ConstraintAttribute::InitiallyImmediate() line 40
- class-const ConstraintAttribute::NotValid() line 41
- class-const ConstraintAttribute::NoInherit() line 41
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: an attribute has no operand.
Parameters
$derivation | Derivation | |
$environment | Environment |
public function render(Output $out): voidWrites the keywords.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 57
- function-call
explodeline 57
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 5
Relations§
Constant reads 32
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:55
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:56
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:57
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:58
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:46
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:47
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:48
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:49
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:50
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:51
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:94
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:94
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:95
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:96
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:97
- class-const SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::attributes() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:97
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:61
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:61
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:64
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:64
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:68
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:68
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:71
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::report() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:74
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::attributes() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:115
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::attributes() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:115
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::attributes() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:124
- class-const SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::attributes() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:124
- class-const SqlSemantics\Platform\PostgreSql\Statement\Catalog\Domain\DomainCheck::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Domain/DomainCheck.php:48
- class-const SqlSemantics\Platform\PostgreSql\Statement\Catalog\Domain\DomainNotNull::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Domain/DomainNotNull.php:45
Type checks 4
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainChecks::constraints() packages/sql-semantics-postgres/src/Rules/Catalog/DomainChecks.php:42
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Attributes::checked() packages/sql-semantics-postgres/src/Rules/Table/Attributes.php:45
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::checked() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:62
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::attributes() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:105