rfc:pdov1

This is an old revision of the document!


Request for Comments: PDO version 1 improvements

  • Version: pre alpha 0.1
  • Date: 2008-03-06
  • Author: Lukas Smith smith@pooteeweet.org
  • Status: Under Discussion

This RFC aims to collect a set of ideas to improve PDO version 1. These ideas will hopefully end up in a set of concret feature requests and patches.

Introduction

PDO is a thin layer above native RDBMS interfaces. As such its focused on providing a unified API on the PHP level without getting too much into SQL abstraction. PDO provides a framework to make the development of RDBMS specific drivers for PDO easier.

Why do we need improvements to PDO?

PDO has become the de-facto standard for the development of PHP libraries that interact with RDBMS. As such developers have come to expect that PDO minimizes any portability differences to a minimum, while accepting that PDO will not solve most issues in the differences of the actual SQL syntax.

Common Misconceptions

A lot in PDO can be fixed without a new major version.

Proposal and Patch

  • Fix differences in behavior for data fetches (possibly add a compatibility mode in order to maintain BC)
  • Add a common syntax to specify the DSN along the lines of the PEAR DSN format
  • Add some better debugging hooks (like a way to get the last submitted statement, this is important especially when PDO does some rewriting like with prepared statements)
  • Fix differences in when bind/prepare issues an exception for an invalid bound value/parameter.
  • Add ability to bind short binary values
  • Add ability to generate a properly quoted comma separated list to be embedded in a query inside an IN() clause (see implodeArray())
  • Better documentation and testing
  • Add support for CLOB fields in Oracle (and other databases) and generally work harder on making the LOB behavior more similar across the drivers (see Bug 7943)
  • Add ability to manage connection session aspects like charset/collation, locale (datetime/currency format)
  • Add limited sub select emulation (see subSelect())
  • Improve the prepared statement emulation parser to better deal with quoted strings that contain things that look like a placeholder
  • Add support of multiple resultsets for mssql and odbc on all platforms.
  • Fix the problems with ODBC prepared statements when executing procedures on all platforms.
  • Add support for datatypes like float and datetime/timestamp
  • Add ability to retrieve the parameters set in the constructor (like DSN etc.)

Rejected Features

  • Add support for “IN (?)” type prepared placeholders. <= native prepared statement mandate that all placeholders only handle a single scalar value

More about PDO

References

Changelog

rfc/pdov1.1209406642.txt.gz · Last modified: 2017/09/22 13:28 (external edit)