Skip to content


DBAL-933: Get Statement Column Metadata #2176

doctrinebot opened this Issue · 1 comment

3 participants


Jira issue originally created by user bburnichon:

It would be nice to have a utility method in \Doctrine\Dbal\Driver\ResultStatement to properly retrieve the result column names.

Currently, we have to rely on somthing like
$columnNames = arraykeys($statement->fetch(\PDO::FETCHASSOC));

Problem: It does not work with empty result-sets, and more checks should be performed to handle these.

With PDO, could be used to properly retrieve names.

For Sqlite3 it is easy,

For Mysql, would do the trick

@beberlei beberlei was assigned by doctrinebot
@deeky666 deeky666 added Improvement and removed New Feature labels
@beberlei beberlei was unassigned by deeky666
@deeky666 deeky666 added this to the 3.0 milestone
Doctrine member

We cannot change this in 2.x as this would require an interface change. Scheduling this to be discussed for 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.