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

A column default written as a literal, NULL or the current timestamp function, without parentheses.

A literal default is the value itself; CURRENT_TIMESTAMP (and its synonyms) is the only function MySQL accepts without parentheses, for TIMESTAMP and DATETIME columns. Source: https://dev.mysql.com/doc/refman/8.4/en/data-type-defaults.html.

Reading the clause of a columndoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a TIMESTAMP DEFAULT 1)');
    $create->statement->elements[0]->specification->attributes[0] instanceof \SqlSemantics\Platform\MySql\Statement\Table\Column\DefaultLiteral // => true

Properties§

public Scalar $value

Methods§

public function __construct(public Scalar $value)

Parameters

$valueScalarThe value
public function deriveAttribute(Derivation $derivation, Environment $scope): void

Derives the value inside the table definition.

Parameters

$derivationDerivation
$scopeEnvironment
Test cases 1
Calls 1
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 1

Test cases 4§

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 3

Relations§

Instantiated in 1
Type checks 1