pdo design
| From: | Ard Biesheuvel | Date: | Sat, 22 May 2004 15:38:40 +0000 |
| Subject: | pdo design | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10028@lists.php.net to get a copy of this message | ||
Guys,
I saw the alpha of PDO on pecl. I was wondering if we could discuss the design of it a bit more before putting too much work into it.
In particular, the way transactions are represented is not very practical. Generally, databases that support transactions will support multiple concurrent transactions against the same database. Firebird also supports transactions against multiple databases. [which does *not* mean you can join tables from different DBs, it just means ACID over multiple DBs]
This means that in some cases you must specify both the connection and the transaction when generating a statement. [I'm not sure if others RDBMSs support this, but it might be something we will see more in the future.]
In short:
In addition to $db->startTransaction(), maybe we could add
PDO::startTransaction($db1 [,$db2 [,$db3]]).
In addition to $db->prepare(), maybe we could add a Transaction interface whose instances would allow being called as
$trans->prepare($query)
and maybe even
$trans->prepare($db, $query)
Your thoughts please ?
--
Ard