Re: metadata in DB.php
| From: | (Stig Sæther Bakken) | Date: | Thu, 22 Mar 2001 13:54:14 +0000 |
| Subject: | Re: metadata in DB.php | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-58@lists.php.net to get a copy of this message | ||
[Christian Stocker <chregu@nomad.ch>]
> Hello
>
> I'm writing at the moment a sql2xml class for pear (give a $DB->result as
> an input, get the xml back from the resultset). i'm almost done for the
> first release, just want to write some documentation before.
>
> But to take advantage of the full functionality of this class, i need
> a metadata-function like the one in phplib. i took the one for mysql and
> made some adaption to the PEAR::DB stuff. you can see the diff-files in
> the attachement. It would be great, if we can integrate that in PEAR::DB
> and if some people could write a metadata-function for the other rdbms as
> well.
>
> If noone objects or has a better solution, i will commit my changes later.
Hi Christian,
Good stuff. I only have some naming suggestions. First of all the
name "metadata" is a bit vague. What about calling it tableInfo()?
Second, for the same reason, in "full" mode, I think the "meta" index
should be named "offset" or "order".
Also, please make a regression test for the MySQL implementation. See
DB/tests/mysql/*.phpt for some examples, let me know if you need any
help.
After you commit this, I think it should be given a testing period
while other backends get support for it, and during this testing
period we're open to API changes (some database extension may have
peculiarities, or we may want to add more information, or maybe make
it possible to retrieve only parts of the information).
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway