Re: DB::isNotManip
| From: | (Stig Sæther Bakken) | Date: | Mon, 23 Apr 2001 08:12:14 +0000 |
| Subject: | Re: DB::isNotManip | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-290@lists.php.net to get a copy of this message | ||
["Tomas V.V.Cox" <cox@idecnet.com>]
> Hi again (hope you don't get tired of me :),
>
> Many extentions use DB::isManip to return or not a result obj. The
> problem with it, is that it doesn't cover all the SQL statments. Now it
> covers INSERT, CREATE, ... but for example doesn't cover specific
> backends statements.
> For example I use some times "SET DATESYLE=..." for PostgreSQL. Now
> there is no problem because the DB/pgsql.php do ereg('SELECT'), but with
> the others like MySQL, DB::isManip is used.
> IMHO it could better to do a DB::isNotManip that only checks for a
> SELECT, than trying to cover all the posible SQL statements with
> isManip.
> I can implement this if you want.
In my experience, there are more uncommon or non-standard queries that
return data than not. That's why DB::isManip ended up like it is.
However, a better solution would be letting each database backend
define its own regexp.
-1 on isNotManip
+1 on putting regexp in connection object and make a (optional) second
parameter to DB::isManip for the connection object
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway