Issue Task Resolved

#110258Use Doctrine introspection API for table and database names

Stefan Bürk 07/21/26, 20:16 updated 08/02/26, 12:15

Description

Doctrine DBAL 4.4 deprecated `AbstractSchemaManager::listTableNames()` and
`AbstractSchemaManager::listDatabases()` in favour of `introspectTableNames()`
and `introspectDatabaseNames()`. Both are removed with Doctrine DBAL 5.0.

The new methods return name value objects – `OptionallyQualifiedName` for tables,
`UnqualifiedName` for databases – instead of plain strings. Six call sites exist:

  • `core/Classes/Database/Schema/SchemaInformation.php`
  • `install/Classes/Service/SetupDatabaseService.php` (three)
  • `install/Classes/Controller/EnvironmentController.php`
  • `install/Classes/Controller/InstallerController.php`

Four of them only count the result or check it for emptiness and therefore need
no name handling at all. The remaining two convert the name objects to strings
immediately, so no Doctrine name object crosses a TYPO3 method boundary. The
public API of `SchemaInformation::listTableNames()` keeps returning `string[]`,
and the payload as well as the identifier of its `database_schema` cache entry
stay unchanged – no cache invalidation needed.

Two details, both verified rather than assumed:

1) `getValue()` is used for the conversion, not `toString()`. The introspection
provider builds the names through `OptionallyQualifiedName::quoted()`, so
`toString()` would render them with identifier quotes and silently change
every consumer of the table name list.

2) The PostgreSQL schema qualifier is preserved. The deprecated path
(`_getPortableTableDefinition()`) omits the schema when it equals the current
schema and prefixes `schema.table` otherwise;
`IntrospectingSchemaProvider::getAllTableNames()` applies the same rule, so
the produced strings are identical.

Equivalence was verified on SQLite, MariaDB, MySQL and PostgreSQL with a
temporary functional test asserting that the old and the new call produce the
same sorted table name list. The test was removed again, it only compares two
APIs of which one is going away.

Note this does not touch column or index introspection – the TYPO3 schema
manager overrides all concern `_getPortableTableColumnDefinition()` and
`_getPortableTableIndexesList()`, which are unaffected by table name lookups.

Reviews 6