final class CreateVirtualTable
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to create a virtual table: a table whose rows and columns a module provides.

Rule: SQLITE-CREATE-VIRTUAL-TABLE-001. The module is named and receives the arguments as text (SQLITE-MODULE-ARGUMENT-001). The columns of the table, its hidden columns and whether it has a rowid are decided by the module when it is created, not by the statement: the statement provides a declaration of the table name without columns that is marked incomplete, so a use of the table depends on its missing member list. A module name that is not registered on the connection is not a fact of the model. A definition with empty parentheses and one without parentheses are the same request to SQLite; the model keeps which was written. Source: https://sqlite.org/lang_createvtab.html, https://sqlite.org/vtab.html. Status: Implemented.

Declaring a virtual table without knowing its columnsdoctest
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE VIRTUAL TABLE docs USING fts5(title, body)');
    [$create->statement->module->value, count($create->statement->arguments), $create->declarations()[0]->complete] // => ['fts5', 2, false]

Properties§

public list<ModuleArgument>|null $arguments
public Name $module
public bool $ifNotExists = false

Methods§

public function __construct(
    public QualifiedName $name,
    public Name $module,
    list<ModuleArgument>|null $arguments = null,
    public bool $ifNotExists = false,
)

Parameters

$nameQualifiedNameThe table name
$moduleNameThe module that implements the table
$argumentslist<ModuleArgument>|nullThe module arguments in order; null when no parentheses are written, otherwise at least one, possibly empty, argument
$ifNotExistsboolWhether IF NOT EXISTS is written
Calls 3
public function deriveStatement(Derivation $derivation): void

Provides the declaration of the table name with an unknown column list.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the definition.

Parameters

$outOutput
Calls 5

Test cases 7§

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 4

Relations§

Instantiated in 1
Type declarations 1