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

SHOW TABLES: the tables and views of a database.

Rule: MYSQL-SHOW-TABLES-001. One column named Tables_in_db after the database written or the current one, Tables_in_db (pattern) with LIKE; FULL adds Table_type. EXTENDED, from MySQL 8.0 on, also lists hidden tables and adds no column. When neither the statement nor the context names the database, the column name depends on the current database of the session and the shape is open. The rows and the WHERE condition are derived by MYSQL-SHOW-FACTS-001. Terminates: a fixed layout. Source: https://dev.mysql.com/doc/refman/8.4/en/show-tables.html. Status: Implemented.

Reading the statementdoctest
$show = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SHOW FULL TABLES FROM shop LIKE 'o%'");
    [$show->field(0)->name?->value, $show->field(1)->name?->value, $show->toString()] // => ['Tables_in_shop (o%)', 'Table_type', "SHOW FULL TABLES FROM shop LIKE 'o%'"]

Properties§

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

Methods§

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

Parameters

$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 2
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Derives the result columns.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 4

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 2