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

DESCRIBE (DESC, EXPLAIN) with a table: the columns of a table or view, as SHOW COLUMNS reports them.

Rule: MYSQL-DESCRIBE-001. The table resolves by MYSQL-SHOW-TARGET-001. A column written after the table is a LIKE pattern the column names must match, written as a name or as a string. The columns are those of SHOW COLUMNS in the layout of MYSQL-SHOW-ROWS-001. DESCRIBE, DESC and EXPLAIN are the same keyword (UtilityNoise); the writer emits DESCRIBE. Terminates: a fixed layout. Source: https://dev.mysql.com/doc/refman/8.4/en/explain.html. Status: Implemented.

Reading a column patterndoctest
$describe = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("DESC t 'a%'");
    [$describe->statement->column?->value, $describe->field(0)->name?->value, $describe->toString()] // => ['a%', 'Field', "DESCRIBE t 'a%'"]

Properties§

public Name|Text|null $column = null

Methods§

public function __construct(public InspectedTable $table, public Name|Text|null $column = null)

Parameters

$tableInspectedTableThe table
$columnName|Text|nullThe pattern of the column names, written as a name or as a string
public function deriveStatement(Derivation $derivation): void

Resolves the table and records the rows.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 4

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 1