Returns a listing of tables in the DB

@param string|null $like The like pattern

@return array|false
199681
public function getTables($like = null)
    {
        $query = $this->getUtilityQuery();
        $like = $like ? $this->bind($like) : null;
        $results = $this->query($query->showTables($like), $this->getBinds());
        $newResults = [];

        foreach ($results as $result) {
            foreach ($result as $key => $value) {
                $newResults[] = $value;
                break;
            }
        }
        
        return $newResults;
    }
344900
public function GetListOfTablesInDatabase() {
        $dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::SHOWTABLES, new \Puzzlout\Framework\Dal\DbQueryFilters());
        $dbConfig->setQuery("SHOW TABLES;");
        $this->addDbConfigItem($dbConfig);
        return $this->BindParametersAndExecute();
    }
1245575
private function getDatabaseStructureTables()
    {
        // Listing all tables from database
        if (empty($this->dumpSettings['include-tables'])) {
            // include all tables for now, blacklisting happens later
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
                array_push($this->tables, current($row));
            }
        } else {
            // include only the tables mentioned in include-tables
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
                if (in_array(current($row), $this->dumpSettings['include-tables'], true)) {
                    array_push($this->tables, current($row));
                    $elem = array_search(
                        current($row),
                        $this->dumpSettings['include-tables']
                    );
                    unset($this->dumpSettings['include-tables'][$elem]);
                }
            }
        }
        return;
    }
305075
public function list_tables()
    {
        // get tables if not cached
        if ($this->tables === null) {
            $q = $this->query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES"
                . " WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA NOT IN ('pg_catalog', 'information_schema')"
                . " ORDER BY TABLE_NAME");

            $this->tables = $q ? $q->fetchAll(PDO::FETCH_COLUMN, 0) : array();
        }

        return $this->tables;
    }
345871
public function list_tables()
    {
        // get tables if not cached
        if ($this->tables === null) {
            // first fetch current database name
            $d = $this->query("SELECT database()");
            $d = $this->fetch_array($d);

            // get list of tables in current database
            $q = $this->query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES"
                . " WHERE TABLE_SCHEMA = ? AND TABLE_TYPE = 'BASE TABLE'"
                . " ORDER BY TABLE_NAME", $d ? $d[0] : '');

            $this->tables = $q ? $q->fetchAll(PDO::FETCH_COLUMN, 0) : array();
        }

        return $this->tables;
    }
154535
public function getTables($resultDetail = false)
    {
        $this->connect();
        $list = [];
        foreach ($this->tables as $db_name=>$tables)
        {
            foreach ($tables as $table_name=>$nodes)
            {

                if ($resultDetail)
                {
                    $list[$db_name . '.' . $table_name] = $nodes;
                } else
                {
                    $list[$db_name . '.' . $table_name] = array_keys($nodes);
                }
            }
        }
        return $list;
    }
463451
protected function _list_tables($prefix_limit = FALSE)
	{
		$sql = 'SELECT "NAME" FROM "SQLITE_MASTER" WHERE "TYPE" = \'table\'';

		if ($prefix_limit === TRUE && $this->dbprefix !== '')
		{
			return $sql.' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' "
				.sprintf($this->_like_escape_str, $this->_like_escape_chr);
		}

		return $sql;
	}
540753
public function showTables($like = null)
    {
        $like = $like ? ' LIKE '.$like : null;
        $this->query = 'SHOW TABLES'.$like;
        return $this;
    }
236660
public function getList($db=true) {
		if(!file_exists($this->dir.'/migrations.json'))
			return [];
		$migrations = json_decode(file_get_contents($this->dir.'/migrations.json'), true);

		if($db) {
			$tracking = [];

			$this->createTable();
			foreach($this->db->dal()->from('_migrations')->get() as $r)
				$tracking[$r['name']] = ['migrated' => strtotime($r['migrated'])];

			foreach($migrations as $migration=>$params) {
				if(isset($tracking[$migration]))
					$migrations[$migration] = array_merge($migrations[$migration], $tracking[$migration]);
			}
		}

		uasort($migrations, function($a, $b) {
			if(isset($a['migrated']) && !isset($b['migrated']))
				return -1;
			elseif(!isset($a['migrated']) && isset($b['migrated']))
				return 1;
			elseif(isset($a['migrated']) && isset($b['migrated'])) {
				if($a['migrated'] !== $b['migrated'])
					return $a['migrated'] > $b['migrated'];
			}
			return $a['added'] > $b['added'];
		});
		
		return $migrations;
	}
488305
public function display($tables = null, $blacklist = null)
    {
        if (empty($tables)) {
            $connection = ConnectionManager::get('default');
            $schema = $connection->getSchemaCollection();
            $tables = $schema->listTables();
            ksort($tables);

            if (!empty($blacklist)) {
                $tables = array_diff($tables, $blacklist);
            }
        }

        $normal = [];
        foreach ($tables as $table => $config) {
            if (is_string($config)) {
                $config = ['table' => $config];
            }

            if (is_int($table)) {
                $table = $config['table'];
            }

            $config += [
                'action' => 'index',
                'title' => Inflector::humanize($table),
                'controller' => Inflector::camelize($table)
            ];

            $normal[$table] = $config;
        }

        return $this->set('tables', $normal);
    }
1128208
public function getTables()
    {
        $tables = [];
        if ($this->serverSupportFeature(3)) {
            $result = $this->runMongoCommand(['listCollections' => 1]);
            foreach ($result as $val) {
                $tables[] = $val['name'];
            }
        } else {
            $result = $this->runMongoQuery('system.namespaces');
            foreach ($result as $val) {
                if (strpos($val['name'], '$') === false) {
                    $tables[] = substr($val['name'], strpos($val['name'], '.') + 1);
                }
            }
        }

        return $tables;
    }
567869
public function getTables()
    {
        $query = Select::i()
            ->select('tablename')
            ->from('pg_tables')
            ->where("tablename NOT LIKE 'pg\\_%'")
            ->where("tablename NOT LIKE 'sql\\_%'")
            ->getQuery();
        
        return $this->query($query);
    }
1037081
public function listDb($wildcard = null)
    {

        $query = DB::table($this->table);
        if (!empty($wildcard)) {
            $query = $query->where('key', 'LIKE', $wildcard . '%');
        }

        return $query;

    }
448769
protected function _list_tables($prefix_limit = FALSE)
	{
		$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database);

		if ($prefix_limit !== FALSE && $this->dbprefix !== '')
		{
			return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'";
		}

		return $sql;
	}
581140
public function getTables()
    {
        if ($this->_tables == self::AUTO_DETECT_TABLES) {
            $tables = $this->_db->show('SHOW TABLES', AnDatabase::FETCH_FIELD_LIST);
            $prefix = $this->_db->getTablePrefix().$this->getIdentifier()->package.'_';
            $schemas = array();
            foreach ($tables as $table) {
                if (strpos($table, $prefix) === 0) {
                    $schemas[] = $table;
                }
            }
        } else {
            $schemas = $this->_tables;
            settype($schemas, 'array');
            $prefix = $this->_db->getTablePrefix();
            $schemas = array_map(function ($table) use ($prefix) {
                return $prefix.$table;
            }, $schemas);
        }

        return $schemas;
    }
960531
public function getTables($db = NULL, $use_cache = true): array
    {
        if (!$db) {
            $db = Configuration::getInstance()->get('db')['name'];
            if (!$db) {
                return [];
            }
        }

        if (Settings::isCacheEnabled()) {
            $cache_key = 'db_table_list_all';
            $cacher = Cacher::getInstance()->getDefaultCacher();

            if (!isset(self::$_table_list[$db])) {
                self::$_table_list[$db] = $cacher->get($cache_key);
            }
        }

        if (!isset(self::$_table_list[$db]) || !$use_cache) {
            self::$_table_list[$db] = $this->q_pairs('SHOW TABLES FROM `' . $db . '`');
        }

        if (Settings::isCacheEnabled()) {
            $cacher->set($cache_key, self::$_table_list[$db], 86400);
        }

        return self::$_table_list[$db];
    }
457582
public function get_tables($usecache = true) {
        if ($usecache and $this->tables !== null) {
            return $this->tables;
        }
        $this->tables = array ();
        $prefix = str_replace('_', '\\_', $this->prefix);
        $sql = "SELECT table_name
                  FROM INFORMATION_SCHEMA.TABLES
                 WHERE table_name LIKE '$prefix%' ESCAPE '\\' AND table_type = 'BASE TABLE'";

        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = sqlsrv_query($this->sqlsrv, $sql);
        $this->query_end($result);

        if ($result) {
            while ($row = sqlsrv_fetch_array($result)) {
                $tablename = reset($row);
                if ($this->prefix !== false && $this->prefix !== '') {
                    if (strpos($tablename, $this->prefix) !== 0) {
                        continue;
                    }
                    $tablename = substr($tablename, strlen($this->prefix));
                }
                $this->tables[$tablename] = $tablename;
            }
            $this->free_result($result);
        }

        // Add the currently available temptables
        $this->tables = array_merge($this->tables, $this->temptables->get_temptables());
        return $this->tables;
    }