Return Table Fields of Requested Table.

@param string $table

@return array Field Type and Field Name
427366
public function describe($table = '')
    {
        $this->sql = $sql = "DESC $table;";
        $this->STH = $this->prepare($sql);
        $this->STH->execute();
        $colList = $this->STH->fetchAll();

        $field = [];
        $type = [];
        foreach ($colList as $key) {
            $field[] = $key['Field'];
            $type[] = $key['Type'];
        }

        return array_combine($field, $type);
    }
244884
public function getTableColumns(string $table): array
    {
        $schemaTable = self::SCHEMA_COLUMN;

        $where[] = "TABLE_NAME = '{$table}'";
        $where[] = "TABLE_SCHEMA = '{$this->db}'";
        $where   = !empty($where) ? ' WHERE ' . implode(' AND ', $where) : null;

        $querySql = "SELECT `COLUMN_NAME` as `name`,`DATA_TYPE` as `type`,`CHARACTER_MAXIMUM_LENGTH` as `length`,`COLUMN_DEFAULT` as `default` ,`COLUMN_KEY` as `key`,`IS_NULLABLE` as `nullable`,`COLUMN_TYPE` as `column_type`,`COLUMN_COMMENT` as `column_comment` FROM {$schemaTable} {$where}";
        $this->dbHandler->prepare($querySql);
        $this->dbHandler->execute([]);
        $columns = $this->dbHandler->fetch();

        return !empty($columns) ? $columns : [];
    }
605805
public function listTableIndexes($table)
    {
        $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase());

        $tableIndexes = $this->_conn->fetchAll($sql);

        return $this->_getPortableTableIndexesList($tableIndexes, $table);
    }
38577
public function getEnumTypedFields(Table $table)
    {
        return $table->getFields()->filter(function (Field $field) {
            return $field->getType() instanceof EnumType;
        });
    }
691263
public function getTableKeys($table)
	{
		$this->connect();

		/** @var OracleQuery $query */
		$query = $this->getQuery(true);

		$fieldCasing = $this->getOption(\PDO::ATTR_CASE);

		$this->setOption(\PDO::ATTR_CASE, \PDO::CASE_UPPER);

		$table = strtoupper($table);
		$query->select('*');
		$query->from('ALL_CONSTRAINTS');
		$query->where('table_name = :tableName');

		$query->bind(':tableName', $table);

		$this->setQuery($query);
		$keys = $this->loadObjectList();

		$this->setOption(\PDO::ATTR_CASE, $fieldCasing);

		return $keys;
	}
712934
public function get_table_definition($table) {
		$statement = $this->get_statement('DESC ' . $this->quote_identifier($table), []);
		$statement->execute();
		$result = $statement->fetch_assoc();
		return $result;
	}
609834
public function getColumns($table)
    {
        $table = str_replace("`", "", $table);

        $columns = Db::fetchAll("SHOW COLUMNS FROM `" . $table . "`");

        $columnNames = array();
        foreach ($columns as $column) {
            $columnNames[] = $column['Field'];
        }

        return $columnNames;
    }
640220
public function tableName($table=null)
	{
		if(null === $table)
		{
			return $this->prefix . $this->table;
		}
		else
		{
			return $this->prefix . $table;
		}
	}
1045794
private function getTextFields($table): array
    {
        $columnsData = $this->model->getReadConnection()->describeColumns($table);
        $textFields = [];

        foreach ($columnsData as $column) {
            switch ($column->getType()) {
                case \Phalcon\Db\Column::TYPE_VARCHAR:
                case \Phalcon\Db\Column::TYPE_TEXT:
                    $textFields[] = $column->getName();
                    break;
            }
        }

        return $textFields;
    }
1159569
public function getTableKeys($table)
    {
        $this->connect();

        $keys = array();
        $query = $this->getQuery(true);

        $fieldCasing = $this->getOption(PDO::ATTR_CASE);

        $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER);

        $table = strtoupper($table);
        $query->setQuery('pragma table_info( ' . $table . ')');

        // $query->bind(':tableName', $table);

        $this->setQuery($query);
        $rows = $this->loadObjectList();

        foreach ($rows as $column)
        {
            if ($column->PK == 1)
            {
                $keys[$column->NAME] = $column;
            }
        }

        $this->setOption(PDO::ATTR_CASE, $fieldCasing);

        return $keys;
    }
654590
protected function _fetchTableColumns($table)
    {
        $result = array();
        $sql    = $this->quoteName($this->getTableNeedle().$table);

        if ($columns = $this->show('SHOW FULL COLUMNS FROM '.$sql, AnDatabase::FETCH_OBJECT_LIST)) {
            foreach ($columns as $column) {
                //Set the table name in the raw info (MySQL doesn't add this)
                $column->Table = $table;

                //Parse the column raw schema data
                $column = $this->_parseColumnInfo($column, $table);

                $result[$column->name] = $column;
            }
        }

        return $result;
    }
845299
protected function getTable($table = '')
    {
        if (empty($table))
        {
            switch (config('auth.driver'))
            {
                case 'eloquent':
                    $table = $this->getTableByModelClass(config('auth.model'));
                    break;
                case 'database':
                default:
                    $table = config('auth.table');
                    break;
            }
        }

        return $table;
    }
1211436
function GetFields($table)
    {
        $fields = array();
        $sql = new Sql\Builder($this);
        $tbl = $sql->Table('information_schema.columns', array('TABLE_SCHEMA', 'TABLE_NAME', 'COLUMN_NAME'));
        $cond = $sql->Equals($tbl->Field('TABLE_SCHEMA'), $sql->Value($this->dbName))
                ->And_($sql->Equals($tbl->Field('TABLE_NAME'), $sql->Value($table)));
        $what = $sql->SelectList($tbl->Field('COLUMN_NAME'));
        $select = $sql->Select(true, $what, $tbl, $cond);
        $reader = $this->ExecuteQuery((string) $select);
        while ($reader->Read())
        {
            $fields[] = $reader->ByIndex(0);
        }
        return $fields;
    }
383329
public function getFields($table)
	{
		if (isset($this->tables[$table])) {
			return new Collection($this->tables[$table]);
		}
	}
290723
protected function _fetchTableColumns($table)
    {
        $return = array();
        $query  = $this->getObject('lib:database.query.show')
            ->show('FULL COLUMNS')
            ->from($table);

        if($columns = $this->select($query, Database::FETCH_OBJECT_LIST))
        {
            foreach($columns as $column)
            {
                // Set the table name in the raw info (MySQL doesn't add this).
                $column->Table = $table;

                $column = $this->_parseColumnInfo($column, $table);
                $return[$column->name] = $column;
            }
        }

        return $return;
    }
1095254
final public function fetchTableDef(string $table) {
        $tableKey = strtolower($table);

        // First check the table cache.
        if (isset($this->tables[$tableKey])) {
            $tableDef = $this->tables[$tableKey];

            if (isset($tableDef['columns'], $tableDef['indexes'])) {
                return $tableDef;
            }
        } elseif ($this->tableNames !== null && !isset($this->tableNames[$tableKey])) {
            return null;
        }

        $tableDef = $this->fetchTableDefDb($table);
        if ($tableDef !== null) {
            $this->fixIndexes($tableDef['name'], $tableDef);
            $this->tables[$tableKey] = $tableDef;
        }

        return $tableDef;
    }
60003
public function getAll($table)
    {
        if (!array_key_exists($table, $this->rows)) {
            $this->loadTable($table);
        }

        return $this->rows[$table];
    }