数か月前、私の仕事では、標準の php mysql_query() 関数を追加のオプションと機能でラップする社内関数をデプロイしました。サンプル機能は、オン/オフできる便利なデバッグ ツールです。
私は、クエリ ハンドラがどれほど人気があり、どのような機能をクエリ ハンドラに組み込むのが好きなのか疑問に思っていました。
同様の理由で、 MDB2、Zend_Db、Doctrineなどの DBAL を使用しています。主に、さまざまなデータベースをサポートしているという事実ではなく、提供されるすべてのショートカットを利用できるようにするためです。
例:
<?php
$query = "SELECT * FROM table";
$result = mysql_query($query);
if (!$result) {
echo mysql_error();
} else {
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_obj($result)) {
...
}
}
}
?>
対 (Zend_Db):
<?php
try {
$result = $db->fetchAll("SELECT * FROM table");
foreach($result as $row) {
...
}
} catch (Zend_Exception $e) {
echo $e->getMessage();
}
?>
私見、より直感的です。
We implemented something similar at my office too. It's proven to be an invaluable to tool for the associated handling features it offers. Error tracking, pre-formatted output and it also works as an 'AL' between MsSQL and MySQL.
Aside from the above features I think it'd be cool to have some low-resource intensive performance monitoring or tracking. For larger or more complicated data sets the queries can be quite weighty and being able to monitor that real-time (or post) would be helpful for any optimization needed on larger-scale websites.
Just my two cents.