Re: Re: [rfc] new getTables Pear DB method
| From: | Tomas V.V.Cox | Date: | Wed, 31 Oct 2001 23:46:39 +0000 |
| Subject: | Re: Re: [rfc] new getTables Pear DB method | ||
| References: | 1 2 | Groups: | php.pear.dev php.pear.general |
| Request: | Send a blank email to pear-dev+get-2497@lists.php.net to get a copy of this message | ||
John Lim wrote:
>
> A lot of interesting tables are actually views. Will they be included?
My original idea was to only list tables, but I have extended it and now
the information returned covers talbes, views, users, databases and
functions (altough not all the info in all the backends has been
implemented yet)
Check the pear/DB/STATUS document to see what is implemented and feel
free to help on the things that are missing now :-)
Tomas V.V.Cox
> Tomas V.V.Cox <cox@idecnet.com> wrote in message
> news:3BD8ABBB.407237D5@idecnet.com...
> > I plan to implement this func for Pear DB (read more about the
> > initiative in pear-general), to get an array with the tables contained
> > in the selected database.
> >
> > ## Proto ##
> >
> > common.php:
> > array getTables();
> >
> > drivers:
> > string _getTablesQuery();
> >
> > ## Implementation (quick) ##
> >
> > function getTables()
> > {
> > return $this->getCol($this->_getTablesQuery);
> > }
> >
> > function _getTablesQuery()
> > {
> > return "show tables";
> > }
> >
> > ## Usage ##
> >
> > $tables_array = $db->getTables();
> >
> >
> > ## More? ##
> >
> > If you find useful, I could add also a extra param: getTables([bool
> > $show_rows=false]), that could return also the number of rows per table
> > when set to true.
> >
> > Please tell me your ideas or die with that :-).
> >
> >
> > Tomas V.V.Cox
> >
> > PS.- This msgs is crossposted in pear-dev and pear-general as there is
> > the main interest for this.
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net