Issue Type: Bug Created: 2009-02-05T04:16:18.000+0000 Last Updated: 2011-12-08T07:51:49.000+0000 Status: Resolved Fix version(s): Reporter: Ashley Kitson (akzincdig) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Db
Related issues: - ZF-6628
describeTable() (via Zend_Db_Table_Abstract->info()) returns a lot of data from its underlying sql call to 'DESCRIBE ' but not all of it.
A significant omission is key information. Whilst Primary Key and Identity information is returned, Unique Key and Index key information is not, forcing the developer to do a second sql 'DESCRIBE ' in their own code to get the rest of the information.
Unfortunately as the Zend_Db_Table_Abstract->_setupMetadata() uses the output of the filtered describeTable() to cache the result, we can't simply reread the cache for the data and this becomes an expensive operation.
Can we have describeTable() return ALL the table information please? I suspect an argument against doing this is that ZF devs have elected to return the Least Common Denominator (LCD) data consistent across all adapter types. I would say that you should normalise the LCD data so it is consistent across all adapters but provide any extra info in an 'extras' parameter of the returned data set so that developers can take advantage of it where possible.
Posted by Ashley Kitson (akzincdig) on 2009-09-18T06:29:41.000+0000
There is a workaround for this. Create your own adapter based on the Zend supplied adapter e.g.
class My_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql;
and then override the describeTable() method to add in the bits that ZF misses out.
be aware of issue ZF-3154 when namimg the new class however.
Have you found an issue?
See the Overview section for more details.