classTableOption
final class TableOption
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One option written after the closing parenthesis of a table definition.
Rule: SQLITE-TABLE-OPTION-001. The grammar accepts WITHOUT name and name for any name. SQLite compares the written text of the name, without regard to ASCII case, with rowid after WITHOUT and with strict otherwise; every other word, and either word in quotes, is the error "unknown table option". The word is therefore kept with its quoting. Source: https://sqlite.org/syntax/table-options.html. Status: Implemented.
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a PRIMARY KEY) STRICT, WITHOUT "rowid"') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: Table option "rowid" is unknown.Properties§
public Word $wordpublic bool $without = falseMethods§
public function __construct(public Word $word, public bool $without = false)Parameters
$word | Word | The option word with its quoting |
$without | bool | Whether WITHOUT is written before the word |
public function kind(): ?TableOptionKindAnswers the option SQLite reads, or null when it rejects the word.
Returns
Test cases 2
Calls 3
- method-call Word::is() line 44
- class-const TableOptionKind::WithoutRowid() line 44
- class-const TableOptionKind::Strict() line 47
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::keyword() line 56
- method-call Output::node() line 58
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 2
Relations§
Instantiated in 2
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\TableConstraintRule::option() packages/sql-semantics-sqlite/src/Lowering/Definition/TableConstraintRule.php:161
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\TableConstraintRule::option() packages/sql-semantics-sqlite/src/Lowering/Definition/TableConstraintRule.php:162
Constant reads 1
Type declarations 2
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\TableConstraintRule packages/sql-semantics-sqlite/src/Lowering/Definition/TableConstraintRule.php:156
- type SqlSemantics\Platform\Sqlite\Statement\Schema\Problem\UnknownTableOption packages/sql-semantics-sqlite/src/Statement/Schema/Problem/UnknownTableOption.php:30