DB stuff

From: Date: Sun, 25 Mar 2001 17:37:42 +0000
Subject: DB stuff
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-89@lists.php.net to get a copy of this message
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. - 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(). - 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. Cheers, Tomas V.V.Cox

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