classDescribeTable
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.
$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 InspectedTable $tableMethods§
public function __construct(public InspectedTable $table, public Name|Text|null $column = null)Parameters
$table | InspectedTable | The table |
$column | Name|Text|null | The pattern of the column names, written as a name or as a string |
public function deriveStatement(Derivation $derivation): voidResolves the table and records the rows.
Parameters
$derivation | Derivation |
Calls 5
- method-call ShowTargets::derive() line 52
- new ShowTargets line 52
- method-call ShowFacts::rows() line 53
- new ShowFacts line 53
- class-const Report::Columns() line 53
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 61
- method-call Output::name() line 63
- class-const NameUse::Column() line 63
- method-call Output::node() line 65
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.