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

SHOW COLUMNS (SHOW FIELDS): the columns of a table or view.

Rule: MYSQL-SHOW-COLUMNS-001. The table resolves by MYSQL-SHOW-TARGET-001; a database written after it replaces the one written with the table name. FULL adds Collation, Privileges and Comment; EXTENDED, from MySQL 8.0 on, also lists hidden columns. The rows and the WHERE condition are derived by MYSQL-SHOW-FACTS-001 from the layout of MYSQL-SHOW-ROWS-001. Terminates: a fixed layout. Source: https://dev.mysql.com/doc/refman/8.4/en/show-columns.html. Status: Implemented.

Reading the statementdoctest
$show = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SHOW FULL FIELDS IN t FROM shop LIKE 'a%'");
    [count($show->fields()), $show->toString()] // => [9, "SHOW FULL COLUMNS FROM t FROM shop LIKE 'a%'"]

Properties§

public ?ShowListing $listing = null
public ?Name $database = null
public ShowLike|ShowWhere|null $filter = null

Methods§

public function __construct(
    public InspectedTable $table,
    public ?ShowListing $listing = null,
    public ?Name $database = null,
    public ShowLike|ShowWhere|null $filter = null,
)

Parameters

$tableInspectedTableThe table
$listing?ShowListingThe FULL and EXTENDED keywords
$database?NameThe database written after FROM or IN; null for the current database
$filterShowLike|ShowWhere|nullThe LIKE or WHERE clause
public function deriveStatement(Derivation $derivation): void

Derives the rows and the filter.

Parameters

$derivationDerivation
Calls 4
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Derives the result columns.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 4

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 2
Type declarations 1