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

The ON UPDATE clause of a TIMESTAMP or DATETIME column: the current timestamp function that updates the column when another column of the row changes.

Source: https://dev.mysql.com/doc/refman/8.4/en/timestamp-initialization.html.

Reading the clause of a columndoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)');
    $create->statement->elements[0]->specification->attributes[0] instanceof \SqlSemantics\Platform\MySql\Statement\Table\Column\OnUpdate // => 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
Calls 1
public function render(Output $out): void

Writes the clause.

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
Type checks 1