Re: suggestions for DB class autoExecute() method

From: Date: Mon, 19 Jan 2004 15:04:53 +0000
Subject: Re: suggestions for DB class autoExecute() method
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25152@lists.php.net to get a copy of this message
Daniel Convissor wrote:
Hi Jim: On Sun, Jan 18, 2004 at 10:34:51PM -0500, Jim Keller wrote:
1. There doesn't appear to be any way to have "as is" values in auto insert /auto update statements, as buildManipSQL uses '?' as the placeholder
Good point. Put in a feature request for this via the bug system. Wow, I just took a look at the code in buildManipSQL(). Performace could benefit from a rewrite. I'll look into both of these issues a little later.
Also note that these were fairly recent additions. Actually iirc there is already a bug report open for this. Essentially it goes along the same lines as adding ! and & support.
2. It may be advantageous to allow users to pass a $where string that includes the WHERE keyword, just for readability in their own code.
... snip ...
3. It might be easier for the user if you were add a simple method, perhaps autoUpdate(), that's just an alias to autoExecute with the $mode set to DB_AUTOQUERY_UPDATE by default.
Nice ideas, but they don't seem like they're worth the overhead.
I agree.
4. In my own class, I was very determined not to allow update queries to execute without a where statement
I don't feel it's DB's job to babysit programmers.
I agree as well. If you need this functionality you should write a simple wrapper class which adds these features. regards, Lukas

« previous php.pear.dev (#25152) next »