classSqliteSchemaReflector
final class SqliteSchemaReflector
implements SchemaReflector, ViewReflector
Public API: explicitly declared with
@visibility public.Fetches SQLite schema information via sqlite_master and PRAGMA queries.
$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
$connection | ConnectionInterface |
$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") // => nullpublic function getCreateStatement(string $tableName): ?stringPublic API: explicitly declared with
@visibility public.{@inheritDoc}
Parameters
$tableName | string |
Returns
?string$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") // => nullTest cases 7
SqliteSchemaReflectorTest::testGetCreateStatementEscapesSingleQuotesInTableNamecallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenNoRowscallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenQueryFailscallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenSqlKeyMissingcallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenSqlNotStringcallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsSqlcallsSqliteSchemaReflectorTest::testGetCreateStatementWithSingleQuoteInTableNamecalls
Calls 3
- method-call ConnectionInterface::query() line 46
- function-call
str_replaceline 49 - function-call
is_stringline 59
public function reflectAll(): arrayPublic API: explicitly declared with
@visibility public.{@inheritDoc}
Returns
array$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
SqliteSchemaReflectorTest::testReflectAllKeepsOnlyValidRowsAmongInvalidcallsSqliteSchemaReflectorTest::testReflectAllMultipleValidTablescallsSqliteSchemaReflectorTest::testReflectAllPrefersTemporaryTableWhenNamesCollidecallsSqliteSchemaReflectorTest::testReflectAllReturnsEmptyWhenQueryFailscallsSqliteSchemaReflectorTest::testReflectAllReturnsSqlValuescallsSqliteSchemaReflectorTest::testReflectAllReturnsTablescallsSqliteSchemaReflectorTest::testReflectAllSkipsInvalidRowscallsSqliteSchemaReflectorTest::testReflectAllSkipsMissingSqlKeycallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithMissingNamecallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithNonStringNamecallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithNonStringSqlcallsSqliteSchemaReflectorTest::testReflectAllSkipsRowWithEmptyNameAndValidSqlcallsSqliteSchemaReflectorTest::testReflectAllSkipsRowWithValidNameAndEmptySqlcalls
Called from 1
Calls 2
- method-call ConnectionInterface::query() line 76
- function-call
is_stringline 95
public function reflectViews(): arrayPublic API: explicitly declared with
@visibility public.{@inheritDoc}
Returns
array$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
- method-call ConnectionInterface::query() line 118
- function-call
is_stringline 131 - method-call SqliteViewDefinitionParser::fromCreateStatement() line 134
- new SqliteViewDefinitionParser line 134
Private surface 1§
Implementation details, listed for orientation only.
private ConnectionInterface $connectionTest cases 23§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 22
SqliteSchemaReflectorTest::testGetCreateStatementEscapesSingleQuotesInTableNamecallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenNoRowscallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenQueryFailscallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenSqlKeyMissingcallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsNullWhenSqlNotStringcallsSqliteSchemaReflectorTest::testGetCreateStatementReturnsSqlcallsSqliteSchemaReflectorTest::testGetCreateStatementWithSingleQuoteInTableNamecallsSqliteSchemaReflectorTest::testReflectAllKeepsOnlyValidRowsAmongInvalidcallsSqliteSchemaReflectorTest::testReflectAllMultipleValidTablescallsSqliteSchemaReflectorTest::testReflectAllPrefersTemporaryTableWhenNamesCollidecallsSqliteSchemaReflectorTest::testReflectAllReturnsEmptyWhenQueryFailscallsSqliteSchemaReflectorTest::testReflectAllReturnsSqlValuescallsSqliteSchemaReflectorTest::testReflectAllReturnsTablescallsSqliteSchemaReflectorTest::testReflectAllSkipsInvalidRowscallsSqliteSchemaReflectorTest::testReflectAllSkipsMissingSqlKeycallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithMissingNamecallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithNonStringNamecallsSqliteSchemaReflectorTest::testReflectAllSkipsRowsWithNonStringSqlcallsSqliteSchemaReflectorTest::testReflectAllSkipsRowWithEmptyNameAndValidSqlcallsSqliteSchemaReflectorTest::testReflectAllSkipsRowWithValidNameAndEmptySqlcallsSqliteSchemaReflectorTest::testReflectViewsPrefersTemporaryAndSkipsMalformedRowscallsSqliteSchemaReflectorTest::testReflectViewsReturnsEmptyWhenQueryFailscalls
Other tests reaching this symbol 1
SqliteSessionFactoryTestcalls