Skip to content

PDO: Make PDO_ATTR_FETCH_TABLE_NAMES generic in PDO - #23872

Draft
NattyNarwhal wants to merge 9 commits into
php:masterfrom
NattyNarwhal:fetch-table-name-generic
Draft

NattyNarwhal wants to merge 9 commits into
php:masterfrom
NattyNarwhal:fetch-table-name-generic

Conversation

@NattyNarwhal

Copy link
Copy Markdown
Member

Rather than having to be re-implemented by each driver. Also makes "table" in getColumnMeta generic as well due to this refactor.

Some notes:

  • ODBC I was not able to get SQLColAttribute with SQL_DESC_TABLE_NAME to work with the Db2i driver; I ahve not tested the SQLite ODBC or SQL Server drivers.
  • DBLIB I'm unsure how to get the table name.
  • PGSQL Fetchin the table name may be expensive due to the query needed. I have not measured; there may also be a better way, but I'm not familiar with libpq.

Previously drivers had to implement this attribute themselves, and only
MySQL and Firebird did so, in spite of support being generic. Remove
driver-specific logic for this as well (Firebird's was harrowing).
@NattyNarwhal
NattyNarwhal force-pushed the fetch-table-name-generic branch from 3b0b122 to 0212ed8 Compare September 24, 2026 00:38
Now that we need this for ATTR_FETCH_TABLE_NAMES, we might as well make
this part of the generic PDO method and not driver specific ones.
@NattyNarwhal
NattyNarwhal force-pushed the fetch-table-name-generic branch from 0212ed8 to cd85c8f Compare September 24, 2026 06:08
In addition to the MySQL specific one.
@NattyNarwhal
NattyNarwhal force-pushed the fetch-table-name-generic branch from cd85c8f to 55c246f Compare September 24, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant