classNullAllowed
final class NullAllowed
implements Constraint
uses Snapshot
Public API: explicitly declared with
@visibility public.A NULL column constraint: the column may hold NULL, which is the default. Mirrors CONSTR_NULL; it conflicts with NOT NULL on the same column.
Source: https://www.postgresql.org/docs/17/sql-createtable.html.
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a int NULL)');
$create->statement->definition->elements[0]->qualifiers[0]->name?->value // => nullProperties§
public Name|null $name = nullMethods§
public function __construct(public Name|null $name = null)Parameters
$name | Name|null | The constraint name |
public function kind(): ConstraintKindpublic function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: the constraint has no operand.
Parameters
$derivation | Derivation | |
$environment | Environment |
public function render(Output $out): voidWrites the constraint.
Parameters
$out | Output |
Calls 3
- method-call Writing::constraintName() line 57
- new Writing line 57
- method-call Output::keyword() line 58
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§
Instantiated in 1
Constant reads 1
Type checks 3
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::conflicts() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:140
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::conflicts() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:141
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Qualifiers::conflicts() packages/sql-semantics-postgres/src/Rules/Table/Definition/Qualifiers.php:144