classModuleArgument
final class ModuleArgument
implements Node
uses Snapshot
@visibility public.One argument of a virtual table module: the exact text SQLite hands to the module.
Rule: SQLITE-MODULE-ARGUMENT-001. "The module-argument syntax is
- sufficiently general that the arguments can be ... anything the module
- wants"; SQLite does not interpret an argument. Arguments are separated by
the commas that are outside every parenthesis. The text of an argument runs from its first token to its last token and includes, unchanged, the white space and comments written between them; white space and comments before the first and after the last token are not part of it. An argument without any token is empty: its commas are kept, and SQLite does not pass it to the module. The text is therefore the operand itself and is kept as a string. A text is accepted only when SQLite reads it back as this one argument. Source: https://sqlite.org/lang_createvtab.html, https://sqlite.org/vtab.html#usage (and sqlite3VtabArgExtend() in vtab.c of the release). Status: Implemented.
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("CREATE VIRTUAL TABLE docs USING fts5(title, body , , tokenize = 'porter ascii')");
[$create->statement->arguments[1]->text, $create->statement->arguments[2]->passed(), $create->statement->arguments[3]->text] // => ['body', false, "tokenize = 'porter ascii'"]Properties§
public string $textMethods§
public function __construct(public string $text)Parameters
$text | string | The exact argument text; empty for an argument without tokens |
Calls 3
- static-call Check::input() line 44
- method-call ModuleArguments::single() line 44
- new ModuleArguments line 44
public function passed(): boolTells whether SQLite passes the argument to the module; it skips empty ones.
Returns
boolTest cases 1
public function render(Output $out): voidWrites the text unchanged.
Parameters
$out | Output |
Test cases 2
Calls 1
- method-call Output::spelled() line 61
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.