final class SqliteSchemaParser
    implements SchemaParserInterface
Public API: explicitly declared with @visibility public.

Simple regex-based parser for SQLite CREATE TABLE statements.

SQLite has a simpler type system based on "type affinity" rather than strict types like MySQL. This parser handles the basic SQLite column definitions and extracts type affinity information.

Read column dimensions and a composite primary keydoctest
$schema = (new \SqlFixture\Platform\Sqlite\SqliteSchemaParser())->parse('CREATE TABLE users (tenant INT, id INT, name VARCHAR(30), PRIMARY KEY (tenant, id))');
    $schema->primaryKeys // => ['tenant', 'id']
    $schema->columns['name']->length // => 30

Methods§

public function parse(string $createTableSql): TableSchema

Parses the supplied declaration into its normalized representation.

Parameters

$createTableSqlstring
Test cases 88
Called from 1
Calls 10

Test cases 100§

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

Dedicated tests 86
Other tests reaching this symbol 14

Relations§

Instantiated in 2
Method calls 1
Type declarations 2