classDefaultNotConstant
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.
(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 $columnMethods§
public function __construct(public Name $column)Parameters
$column | Name | The column whose default is not constant |
public function message(): stringDescribes the problem.
Returns
stringTest 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
AlterationProblemsTest::testAddedReportsEveryObstacleOfTheNewColumncallsExplainTest::testDeriveStatementDiscardsTheRowsAndTheDeclarationOfTheInspectedStatementcallsColumnConstraintTest::testDeriveConstraintDerivesEachKindOfOperandInItsOwnScopecallsColumnDefinitionTest::testDeriveColumnReportsADefaultNotConstantAndADefaultOnAGeneratedColumncallsDefaultExpressionTest::testDeriveConstraintSeesNoColumncalls