classSqliteSchemaFetcher
final class SqliteSchemaFetcher
implements SchemaFetcherInterface
Fetches table schemas from SQLite databases.
Uses PRAGMA table_info to build the schema directly, avoiding the need to parse CREATE TABLE statements for simple cases. Falls back to sqlite_schema for full CREATE TABLE parsing when needed.
Methods§
public function __construct(?SqliteSchemaParser $parser = null)Initializes the collaborators and declared state for this object.
Parameters
$parser | ?SqliteSchemaParser |
Calls 1
public function fetchSchema(PDO $pdo, string $tableName): TableSchemaReads the named table from the selected database connection.
Parameters
$pdo | PDO | |
$tableName | string |
Returns
Test cases 9
SqliteSchemaFetcherTest::testFetchSchemaFromSqliteTablecallsSqliteSchemaFetcherTest::testFetchSchemaWithAutoincrementcallsSqliteSchemaFetcherTest::testFetchSchemaWithCustomParsercallsSqliteSchemaFetcherTest::testFetchSchemaWithDecimalPrecisionScalecallsSqliteSchemaFetcherTest::testFetchSchemaWithDefaultCurrentTimestampcallsSqliteSchemaFetcherTest::testFetchSchemaWithDefaultValuescallsSqliteSchemaFetcherTest::testFetchSchemaWithNullableColumnscallsSqliteSchemaFetcherTest::testFetchSchemaWithVarcharLengthcallsSchemaFetcherInterfaceTest::testFetchSchemaReflectsDeclaredColumnscalls
Calls 5
- method-call CreateTableQuery::fetchCreateTableSql() line 35
- new CreateTableQuery line 35
- method-call SqliteSchemaParser::parse() line 38
- method-call PragmaSchema::fetchSchemaViaPragma() line 41
- new PragmaSchema line 41
Private surface 1§
Implementation details, listed for orientation only.
private SqliteSchemaParser $parserTest cases 18§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
SqliteSchemaFetcherTest::testFetchSchemaFromSqliteTablecallsSqliteSchemaFetcherTest::testFetchSchemaWithAutoincrementcallsSqliteSchemaFetcherTest::testFetchSchemaWithCustomParsercallsSqliteSchemaFetcherTest::testFetchSchemaWithDecimalPrecisionScalecallsSqliteSchemaFetcherTest::testFetchSchemaWithDefaultCurrentTimestampcallsSqliteSchemaFetcherTest::testFetchSchemaWithDefaultValuescallsSqliteSchemaFetcherTest::testFetchSchemaWithNullableColumnscallsSqliteSchemaFetcherTest::testFetchSchemaWithVarcharLengthcalls
Other tests reaching this symbol 10
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsDatabaseFixtureProviderTest::testFixtureWithCustomSchemaFetchercallsFileFixtureProviderTestcallsFixtureProviderTestcallsPlatformFactoryTest::testCreateSchemaFetcherForSqlitecallsDatabaseSchemaCacheTest::testClearReflectsSubsequentDdlChangescallsDatabaseSchemaCacheTest::testGetSchemaReusesTheParsedTableUntilInvalidatedcallsSqlSchemaProviderTestcallsSchemaFetcherInterfaceTest::testFetchSchemaReflectsDeclaredColumnscalls