final class PgSqlSchemaParser
    implements SchemaParser
Public API: explicitly declared with @visibility public.

PostgreSQL implementation of SchemaParser.

Parses CREATE TABLE statements into structured schema metadata.

Read primary keys from table DDLdoctest
(new \ZtdQuery\Platform\Postgres\Schema\PgSqlSchemaParser())->parse('CREATE TABLE users (id INTEGER PRIMARY KEY)')?->primaryKeys // => ['id']

Methods§

public function parse(string $createTableSql): ?TableDefinition
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Parameters

$createTableSqlstring
Read columns and the primary key from a table definitiondoctest
$definition = (new \ZtdQuery\Platform\Postgres\Schema\PgSqlSchemaParser())->parse('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)');
    $definition?->columns // => ['id', 'name']
    $definition?->primaryKeys // => ['id']
Test cases 243
Called from 1
Calls 8

Test cases 494§

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

Dedicated tests 201
Other tests reaching this symbol 293

Relations§

Instantiated in 2
Method calls 1
Type declarations 1