final class LiteralDefaults
Restricted visibility: declared "@visibility SqlSemantics\Platform\Sqlite". Code outside that scope must not name this declaration.

Reads the DEFAULT clauses of a column the way ALTER TABLE ADD COLUMN does.

Rule: SQLITE-LITERAL-DEFAULT-001. When a column is added, SQLite computes its default once, with the routine that turns a literal expression into a value: it looks through parentheses, a unary plus or minus and a CAST, and accepts a number, a string, a BLOB, NULL, TRUE, FALSE and the identifier after DEFAULT; everything else, CURRENT_TIME, CURRENT_DATE and CURRENT_TIMESTAMP included, is "a column with non-constant default". A default written as the literal NULL, in parentheses or not, is read as no default at all. Terminates: each step removes one wrapper of a finite expression. Source: https://sqlite.org/lang_altertable.html#alter_table_add_column (and sqlite3AlterFinishAddColumn() in alter.c and valueFromExpr() in vdbemem.c of the release). Status: Implemented.

Methods§

public function constant(Scalar $expression): bool

Tells whether an expression is a literal under parentheses, signs and casts.

Parameters

$expressionScalar

Returns

bool
Test cases 1
Called from 1
Calls 3

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 1
Method calls 3