final class SqliteSchemaReflector
    implements SchemaReflector, ViewReflector
Public API: explicitly declared with @visibility public.

Fetches SQLite schema information via sqlite_master and PRAGMA queries.

Reflect an empty connectiondoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $reflector = new \ZtdQuery\Platform\Sqlite\Schema\SqliteSchemaReflector($connection);
    $reflector->reflectAll() // => []

Methods§

public function __construct(ConnectionInterface $connection)
Public API: explicitly declared with @visibility public.

Binds the dependencies used by this operation.

Parameters

Bind a connection to schema reflectiondoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $reflector = new \ZtdQuery\Platform\Sqlite\Schema\SqliteSchemaReflector($connection);
    $reflector->getCreateStatement("missing") // => null
public function getCreateStatement(string $tableName): ?string
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Parameters

$tableNamestring

Returns

?string
Return null when a table is absentdoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $reflector = new \ZtdQuery\Platform\Sqlite\Schema\SqliteSchemaReflector($connection);
    $reflector->getCreateStatement("missing") // => null
Test cases 7
Calls 3
public function reflectAll(): array
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Returns

array
Return no tables when the connection yields nonedoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $reflector = new \ZtdQuery\Platform\Sqlite\Schema\SqliteSchemaReflector($connection);
    $reflector->reflectAll() // => []
Test cases 13
Called from 1
Calls 2
public function reflectViews(): array
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Returns

array
Return no views when the connection yields nonedoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $reflector = new \ZtdQuery\Platform\Sqlite\Schema\SqliteSchemaReflector($connection);
    $reflector->reflectViews() // => []
Test cases 2
Called from 1
Calls 4

Private surface 1§

Implementation details, listed for orientation only.

private ConnectionInterface $connection

Test cases 23§

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

Dedicated tests 22
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Method calls 2