final class DefaultOfColumn
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

The default value of a column: DEFAULT(col) (Item_default_value).

Rule: MYSQL-COLUMN-DEFAULT-001. Facts: the type and NULL fact of the column; a NOT NULL column has no NULL default (the server rejects the function for a NOT NULL column without default). Terminates: the column is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/miscellaneous-functions.html#function_default. Status: Implemented.

Reading the columndoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = DEFAULT(a)');
    $query->statement->where->right->column->name->value // => 'a'

Properties§

public ColumnUse $column

Methods§

public function __construct(public ColumnUse $column)

Parameters

$columnColumnUseThe column whose default is read
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the column; the default has its facts.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 2
public function render(Output $out): void

Writes DEFAULT and the column in parentheses.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type checks 1