classDefaultLiteral
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.
$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 // => trueProperties§
public Scalar $valueMethods§
public function __construct(public Scalar $value)Parameters
$value | Scalar | The value |
public function deriveAttribute(Derivation $derivation, Environment $scope): voidDerives the value inside the table definition.
Parameters
$derivation | Derivation | |
$scope | Environment |
Test cases 1
Calls 1
- method-call Derivation::scalar() line 40
public function render(Output $out): voidTest cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.