I want to start to collect a little RFC on what needs to be changed in PDOv1 (yes, not much to se there right now) to make it better. So I am not talking about PDOv2 here. What can be done to make the current PDO more useful to people? What are the key features missing, issues bugging you? Just put up a comment here or shoot me a mail. Or if you have a PHP CVS account, just feel free to login on the wiki and edit.
I don't know whats already there... so I imagine this might be.
I wish I could see the SQL that is created via prepared statements - it would make it easier to debug.
The ability to bind short binary values.
Like those returned from hash('sha1', $data, true).. 20 bytes long and either forced to encode in some base (16, 64) and waste space, or use the LOB streams.
ANSI sql standard allows X'1234567890abcdef' encoding to get the values in.
Ability to bind arrays. This would be useful to create WHERE x IN (?) style conditions. I guess the problem with this is that few (if any) database apis provide functions to do this. Therefore PDO would have to implement, but that would remove an advantage of preparing statements.
I would be great if I could do something like
$stmt = $db->prepare('SELECT x FROM y WHERE z IN (:vals)');
$data = array(
'vals' => array(1, 2, 3));
PDO would then expand this to:
SELECT x FROM y WHERE z IN (1, 2, 3)
It would be great if we could do this :
$stmt = $db->prepare('SELECT x FROM y WHERE field1=:field and field2=:field');
And when you bind field, it bind it on the 2 ":field"...
For those of us running on servers that share the database with other subsystems (such as email/anti-spam data), it's important to be able to set the connection limit so that PHP can't 'freeze out' the email system by taking all available connections.
Ideally, there would be one "mysql connection limit" that mysql, mysqli, and pdo-mysql would all share, but I'm not sure how feasible that is.
A better documentation of everything, some methods have any or very few documentation on how to use it.
I have to agree with Dougal, the ability to view the SQL created by prepared statements. It would make debugging so much easier.
One method to see the binded query string would be great for debugging.
PDO does not support CLOB fields in Oracle.
When I've worked with PDO in my project, I found myself being unable to bind CLOB field correctly. Always got the "inconsistent datatypes" error. And when I tried to use straight INSERT into CLOB field, I couldn't insert more then 4k bytes of data, which makes sense but doesn't really help me.
So I digged deeper and found out that this problem was described already, but there was no official fix made for it. You can read about it here: http://pecl.php.net/bugs/bug.php?id=7943.
Because of this I was forced to rewrite my database access layer using OCI8 library. Now I can work with CLOB without any problems, but PDO has its advantages (variables binding is more convenient, for example). So I am really looking forward to have better Oracle support in PDO.