Pushing PDO

I’m really glad to see Lukas planning to push PDO a step higher. I think it’s already a decent extension, and has a bright future — since I first used the extension I’ve never ever used anything else for any database. It’s object-oriented, has a lean interface, it’s fast, and supports a major feature: prepared statements. I’ve completely forgotten about having to escape, because I always insert/update through these. Seeing mysql_real_escape_string() anywhere in code makes me sad, and seeing $db = mysql_connect() and then passing the resource around makes me sick :). Yes, you can use a class to wrap this up, but why would you? PDO is just that and more.

The only thing I miss is some sort of prepared statement inspection. You prepare it, and you pass the parameters, but you can’t find out what the query actually looks like. This would come in handy for logging, but it may be impossible to implement in the extension, because as I understand prepared statements are assembled by the database itself, unless they’re emulated by the extension.