final class DefaultNotConstant
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

A DEFAULT expression that SQLite does not accept as a constant.

"An expression is considered constant if it contains no sub-queries,

  • column or table references, bound parameters, or string literals enclosed
  • in double-quotes"; a RAISE function is not constant either. SQLite rejects

the definition with "default value of column [name] is not constant". Source: https://sqlite.org/lang_createtable.html#the_default_clause.

Reporting a bound parameter in a defaultdoctest
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a DEFAULT (?))') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: The default value of column a is not constant.

Properties§

public Name $column

Methods§

public function __construct(public Name $column)

Parameters

$columnNameThe column whose default is not constant
public function message(): string

Describes the problem.

Returns

string
Test cases 1

Test cases 7§

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

Dedicated tests 2
Other tests reaching this symbol 5

Relations§

Instantiated in 1