final class EnforcementAttribute
    implements ColumnAttribute
    uses Snapshot
Public API: explicitly declared with @visibility public.

An ENFORCED or NOT ENFORCED attribute of a column, which applies to the CHECK constraint written before it.

Source: https://dev.mysql.com/doc/refman/8.4/en/create-table-check-constraints.html.

Reading the attribute of a columndoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a INT CHECK (a > 0) NOT ENFORCED)');
    $create->statement->elements[0]->specification->attributes[1]->enforced // => false

Properties§

public bool $enforced

Methods§

public function __construct(public bool $enforced)

Parameters

$enforcedboolWhether ENFORCED is written without NOT
public function deriveAttribute(Derivation $derivation, Environment $scope): void

Derives nothing: the attribute holds no expression.

Parameters

$derivationDerivation
$scopeEnvironment
public function render(Output $out): void

Writes the attribute.

Parameters

$outOutput
Calls 1

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