Get the list of tables available in the current connection.

@return array The list of tables in the connected database/schema.
542918
public function listTables()
    {
        list($sql, $params) = $this->_dialect->listTablesSql($this->_connection->config());
        $result = [];
        $statement = $this->_connection->execute($sql, $params);
        while ($row = $statement->fetch()) {
            $result[] = $row[0];
        }
        $statement->closeCursor();

        return $result;
    }
709340
public function getDatabases()
    {
        $data = [];

        foreach ($this->getMonitoredDatabases() as $db) {
            $data[] = ['connection' => $db['connection'],
                       'alert_greater_than_mb' => $db['alert_greater_than_mb'],
                       'alert_less_than_mb' => $db['alert_less_than_mb'],
                       'driver' => $this->getDriverName($db['connection']),
                       'status' => $this->checkDatabaseStatus($db['connection']),
                       'size' => $this->getDatabaseSize($db['connection'])];
        }

        return $data;
    }
90512
public function tableList($schema = null)
    {
        $list = $this->fetchAll('SHOW TABLES;');
        $tables = [];
        foreach ($list as $row) {
            foreach ($row as $name) {
                $tables[] = $name;
            }
        }
        return $tables;
    }
1192752
public function getTables(): array
    {
        $result = [];
        foreach ($this->getDriver(self::READ)->tableNames() as $table) {
            if ($this->prefix && strpos($table, $this->prefix) !== 0) {
                //Logical partitioning
                continue;
            }

            $result[] = $this->table(substr($table, strlen($this->prefix)));
        }

        return $result;
    }
650930
public function getTables()
    {
        if (!$this->_allTablesFetched) { // Fetch only once
            $tables = $this->getTableNames();
            // Fetch missing tables
            foreach ($tables as $table) {
                $this->getTable($table); // Discard result, still available in cache
            }
            // Sort cache
            ksort($this->_tables);
            // Set flag for subsequent invocations
            $this->_allTablesFetched = true;
        }
        return $this->_tables;
    }
436862
public function getTables()
    {
        if (is_null($this->_tables)) {

            $result = $this->_adapter->query(
                $this->_getTablesSql,
                [$this->_adapter->getSchemaName()]
            );

            $names = [];
            foreach ($result as $table) {
                $names[] = $table['TABLE_NAME'];
            }
            $this->_tables = $names;
        }
        return $this->_tables;
    }
738754
private function getDbTables()
    {
        $oDB = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_NUM);
        $aTables = $oDB->getCol("SHOW TABLES");

        foreach ($aTables as $iKey => $sTable) {
            if (strpos($sTable, 'oxv_') === 0) {
                unset($aTables[$iKey]);
            }
        }

        return $aTables;
    }
268605
protected function obtainConnectedServerList(): array
    {
        $serversList = $this->getServerList();
        $servers     = [];
        
        foreach ($serversList as $serverInfos) {
            $servers[] = $serverInfos['host'].':'.$serverInfos['port'];
        }
        
        return $servers;
    }
446006
public function getSchema()
    {
        $this->output->writeln('Load current database schema.');
        $result = [];

        $result['database'] = $this->getDatabaseSchemata($this->dbName);

        $tables = $this->getTables();
        foreach ($tables as $table) {
            $tableName = $table['table_name'];
            $this->output->writeln(sprintf('Table: <info>%s</info>', $tableName));
            $result['tables'][$tableName]['table'] = $table;
            $result['tables'][$tableName]['columns'] = $this->getColumns($tableName);
            $result['tables'][$tableName]['indexes'] = $this->getIndexes($tableName);
            $result['tables'][$tableName]['foreign_keys'] = $this->getForeignKeys($tableName);
        }

        return $result;
    }
652307
public function getSchemaTables(): array
    {
        if (empty($this->db)) {
            return [];
        }
        $schemaTable = self::SCHEMA_TABLES;
        $where[]     = "TABLE_TYPE = 'BASE TABLE'";
        $where[]     = "TABLE_SCHEMA = '{$this->db}'";
        if (!empty($this->tablesEnabled)) {
            $tablesEnabled = array_map(function ($item) {
                return "'{$item}'";
            }, $this->tablesEnabled);
            $where[]       = 'TABLE_NAME IN (' . implode(',', $tablesEnabled) . ')';
        }
        if (!empty($this->tablesDisabled)) {
            $tablesDisabled = array_map(function ($item) {
                return "'{$item}'";
            }, $this->tablesDisabled);
            $where[]        = 'TABLE_NAME NOT IN (' . implode(',', $tablesDisabled) . ')';
        }
        $where = !empty($where) ? ' WHERE ' . implode(' AND ', $where) : null;

        $querySql = "SELECT `TABLE_NAME` AS `name`,`TABLE_COMMENT` as `comment` FROM {$schemaTable} {$where}";
        $this->dbHandler->prepare($querySql);
        $this->dbHandler->execute([]);
        $this->tables = $this->dbHandler->fetch();

        return !empty($this->tables) ? $this->tables : [];
    }
1340135
public function listTables($schema = null)
    {
        $this->_connect();

        if ($schema === null && $this->_config['schema'] != null) {
            $schema = $this->_config['schema'];
        }

        $tables = array();

        if (!$this->_isI5) {
            if ($schema) {
                $stmt = db2_tables($this->_connection, null, $schema);
            } else {
                $stmt = db2_tables($this->_connection);
            }
            while ($row = db2_fetch_assoc($stmt)) {
                $tables[] = $row['TABLE_NAME'];
            }
        } else {
            $tables = $this->_i5listTables($schema);
        }

        return $tables;
    }
633676
protected function getTableColumns()
    {
        if (0 === count(self::$tableColumns)) {
            $table = $this->getTable();
            $connect = $this->getConnection();
            $builder = $connect->getSchemaBuilder();
            $columns = $builder->getColumnListing($table);

            self::$tableColumns = (array)$columns;
        }
        return self::$tableColumns;
    }
12428
public function getTables(): array
	{
		$result = [];
		$tables = $this->connection->getPlatform()->getTables();
		foreach ($tables as $table) {
			$result[] = $table['name'];
		}
		return $result;
	}
683486
public function getSqlTablesArray()
    {
        $names = Yii::$app->db->schema->tableNames;
    
        return array_combine($names, $names);
    }
852632
public function getDatabases() {
		$client = $this->getClient();

		if ($this->_profilerEnabled) {
			$event = $this->getProfiler()->startRead('Databases list');
		}

		$databasesRaw = $client->listDBs();

		if ($this->_profilerEnabled) {
			$event->stopSuccess();
		}

		$databases = [];

		foreach ($databasesRaw['databases'] as $database) {
			$databases[] = $database['name'];
		}

		return $databases;
	}
663314
protected function _get_table_info()
    {
        $this->table_info = array();
        $db = Fruit_db::get_instance($this->connection);
        $db->query("SHOW COLUMNS FROM `{$this->table}`");
        $this->table_info[$this->table] = $db->result();
        if ($this->join)
        {
            foreach ($this->join as $alias => $join)
            {
                $db->query("SHOW COLUMNS FROM `{$join['join_table']}`");
                $this->table_info[$alias] = $db->result();
            }
        }
        return true;
    }
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;
    }