classDefaultOfColumn
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.
$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 $columnMethods§
public function __construct(public ColumnUse $column)Parameters
$column | ColumnUse | The column whose default is read |
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the column; the default has its facts.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call Derivation::scalar() line 46
- new ScalarFact line 48
public function render(Output $out): voidWrites DEFAULT and the column in parentheses.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 56
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.