Re: [rfc] new getTables Pear DB method
| From: | John Lim | Date: | Wed, 31 Oct 2001 16:46:05 +0000 |
| Subject: | Re: [rfc] new getTables Pear DB method | ||
| References: | 1 | Groups: | php.pear.dev php.pear.general |
| Request: | Send a blank email to pear-dev+get-2490@lists.php.net to get a copy of this message | ||
A lot of interesting tables are actually views. Will they be included?
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.