final class ModuleArgument
    implements Node
    uses Snapshot
Public API: explicitly declared with @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.

Reading the arguments a module receivesdoctest
$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 $text

Methods§

public function __construct(public string $text)

Parameters

$textstringThe exact argument text; empty for an argument without tokens
Calls 3
public function passed(): bool

Tells whether SQLite passes the argument to the module; it skips empty ones.

Returns

bool
Test cases 1
public function render(Output $out): void

Test cases 6§

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 3

Relations§

Instantiated in 1
Constant reads 1