ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back 1  2  3  »  

What don't you like about PDO?

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.


Re: What don't you like about PDO?

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.

Re: What don't you like about PDO?

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.

Re: What don't you like about PDO?

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)

Re: What don't you like about PDO?

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"...

Connection Limits

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.

Re: What don't you like about PDO?

A better documentation of everything, some methods have any or very few documentation on how to use it.

Re: What don't you like about PDO?

I have to agree with Dougal, the ability to view the SQL created by prepared statements. It would make debugging so much easier.

Re: What don't you like about PDO?

One method to see the binded query string would be great for debugging.

Re: What don't you like about PDO?

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.

Before you can post a comment please solve the following captcha.

your name:

1  2  3  »