Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why PDO driver doesn't allow list tables and columns #106

Open
hkdobrev opened this issue Jul 28, 2016 · 4 comments
Open

Why PDO driver doesn't allow list tables and columns #106

hkdobrev opened this issue Jul 28, 2016 · 4 comments

Comments

@hkdobrev
Copy link

hkdobrev commented Jul 28, 2016

$this->_connection->query('SHOW TABLES')->fetchAll(\PDO::FETCH_COLUMN)

should work.

Any idea why it's made to throw an exception for the PDO driver?

@shadowhand
Copy link
Contributor

@hkdobrev
Copy link
Author

Hmm, ok. Fair enough, but the database configuration states if it is MySQL or not. Can't we actually implement different queries based on the database specified in the DSN?

@acoulton
Copy link
Member

@hkdobrev in principle I don't see why not, I think that could be useful. But it would need to be done in a clean, sensible way (potentially with some sort of sql abstraction class for each supported backend) and well-tested.

If you want to try it, then go ahead - I'd merge it as a new feature (for the 3.4 branch) if the implementation is OK. If not, then it's a nice idea but I can't promise anyone will have time or inclination to work on it.

Personally, I'd just add this at the application level if required, or use an existing more fully-featured DB abstraction package like Doctrine.

@enov
Copy link
Contributor

enov commented Aug 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants