Re: DB stuff
| From: | (Stig Sæther Bakken) | Date: | Mon, 26 Mar 2001 06:43:05 +0000 |
| Subject: | Re: DB stuff | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-92@lists.php.net to get a copy of this message | ||
["Tomas V.V.Cox" <cox@idecnet.com>]
> Hi ppl,
>
> Here are some considerations about possible changes in Pear DB:
>
> - All the backend extensions have in the connect method a check like
> that:
>
> if (is_array($dsn)) {
> $dsninfo = &$dsn;
> } else {
> $dsninfo = DB::parseDSN($dsn);
> }
> if (!$dsninfo || !$dsninfo['phptype']) {
> return $this->raiseError(); // XXX ERRORMSG
> }
> This is made now in DB::connect. I think we have to start removing this
> peace of code from all backends.
Agreed.
> - IMHO there is no need to mantain two versions with the same
> functionality of fetchrow (fetchrow() and fetchinto()). I propose to
> erase one in backend extensions and "emulate" the other throw DB_result.
> Something like this in DB_result:
>
> // this code is only an approach
> function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT)
> {
> $res = $this->fetchInto ($arr, $fetchmode);
> if (is_object($res)) {
> return $res;
> }
> return $arr;
> }
> So, in extensions we'll only need fetchInto().
Also agreed.
> - Can I start start coding the new "fetch absolute row numbers"
> capability in DB_result? DB_ifx and DB_pgsql (this last not yet
> commited) have now this feature implemented.
Sure, go ahead. Could you also make the backends that don't support
it yet return "not capable" if they get a non-null row-offset
parameter?
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway