get database fileds

@param Table $table
@return array
179093
protected function getTableFields(Table $table)
	{
		$fileds = [];

		foreach ($table->getColumns() as $column) {
			$fileds[] = [
	            'name' => $column->getName(),
	            'type' => $column->getType()->getName(),
	            'not_null' => $column->getNotnull(),
	            'length' => $column->getLength(),
	            'unsigned' => $column->getUnsigned(),
	            'autoincrement' => $column->getAutoincrement(),
	            'primary_key' => $this->isPrimaryKey($table, $column),
	            'foreign_key' => $this->isForeignKey($table, $column)
			];
		}

		return $fileds;
	}
1080747
private function _getColumns($table)
    {
        if (isset($this->_tables[$table])) {
            return $this->_tables[$table];
        };
        $this->_tables[$table] = false;
        if ($rows = $this->selectArray("PRAGMA table_info({$table})")) {
            $cols = array();
            foreach ($rows as $row) {
                $cols[] = $row['name'];
            };
            if (count($cols) > 0) {
                $this->_tables[$table] = $cols;
            };
        };
        return $this->_tables[$table];
    }
41007
public function getTableDetail($table)
    {
        $tables = $this->getTableDetails();

        $table = $this->db->replacePrefix($table);

        if (!isset($tables[$table])) {
            return false;
        }

        return $tables[$table];
    }
83931
public function getColumns($table)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $query = $this->utility()->showColumns($table);
        $results = $this->query($query, $this->getBinds());
        
        $columns = array();
        foreach ($results as $column) {
            $key = null;
            if ($column['pk'] == 1) {
                $key = 'PRI';
            }
            
            $columns[] = array(
                'Field'     => $column['name'],
                'Type'      => $column['type'],
                'Default'   => $column['dflt_value'],
                'Null'      => $column['notnull'] != 1,
                'Key'       => $key);
        }
        
        return $columns;
    }
996106
public function getIndexes($table): ?array
	{
		return $this->driverQuery($this->getSql()->indexList($this->prefixTable($table)), FALSE);
	}
1275293
protected function _seeTableInDatabase($table)
    {
        $dbh = $this->_getDbh();
        $sth = $dbh->prepare('SHOW TABLES LIKE :table');
        $this->debugSection('Query', $sth->queryString);
        $sth->execute(['table' => $table]);
        $count = $sth->rowCount();

        return $count == 1;
    }
1325695
public function getDefaultValuesFields(Table $table)
    {
        return $table->getFields()->filter(function (Field $field) {
            return $field->getDefault() !== null;
        });
    }
932744
protected function getTableKey($table) {
        if (empty(static::$tableKeys)) {
            $this->loadTableKeys();
        }

        return isset(static::$tableKeys[$table]) ? static::$tableKeys[$table] : static::$tableKeys['__default__'];
    }
1335176
public function hasTable($table)
    {
        $conn = $this->connection->getConnection();
        $db = r\db($this->connection->getDatabaseName());
        $tables = $db->tableList()->run($conn);

        return in_array($table, $tables);
    }
713000
public function getColumnTypes($table)
    {
        $columns = $this->getSchemaManager()->listTableColumns($table);

        $columnTypes = [];
        foreach ($columns as $column) {
            $columnTypes[$column->getName()] = $column->getType()->getName();
        }

        if (!isset($this->overwrittenColumnTypes[$table])) {
            return $columnTypes;
        }

        return \array_merge($columnTypes, $this->overwrittenColumnTypes[$table]);
    }
211996
private function getTableData($tables)
    {
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

        $data = array();
        foreach ($tables as $table) {
            $data[$table] = array();

            $result = $db->select("SELECT * FROM `${table}`");
            if ($result && $result->count() > 0) {

                $rows = array();
                while (!$result->EOF) {
                    $rows[] = $result->fields;

                    $result->fetchRow();
                }
                $data[$table]["_sql_"] = $this->getInsertString($rows, $table);
            }
        }

        return $data;
    }
383329
public function getFields($table)
	{
		if (isset($this->tables[$table])) {
			return new Collection($this->tables[$table]);
		}
	}
1008575
protected function getInserts($table)
    {
        $db       = $this->db;
        $query    = $db->getQuery(true);
        $iterator = $db->getReader($query->select('*')->from($query->quoteName($table)))->getIterator();

        if (!count($iterator)) {
            return null;
        }

        $sql = [];

        foreach ($iterator as $data) {
            $data = (array) $data;

            $data = array_map(
                function ($d) use ($query) {
                    return $query->q($d) ?: 'NULL';
                },
                $data
            );

            $value = implode(', ', $data);

            $sql[] = (string) sprintf("INSERT `%s` VALUES (%s)", $table, $value);
        }

        return (string) implode(";\n", $sql);
    }
1158288
public function list_cols($table)
    {
        $q = $this->query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?',
            array($table));

        if ($q) {
            return $q->fetchAll(PDO::FETCH_COLUMN, 0);
        }

        return array();
    }
963015
protected function _fetchTableIndexes($table)
    {
        $return = array();
        $query  = $this->getObject('lib:database.query.show')
            ->show('INDEX')
            ->from($table);

        if($indexes = $this->select($query, Database::FETCH_OBJECT_LIST))
        {
            foreach($indexes as $index) {
                $return[$index->Key_name][$index->Seq_in_index] = $index;
            }
        }

        return $return;
    }
712934
public function get_table_definition($table) {
		$statement = $this->get_statement('DESC ' . $this->quote_identifier($table), []);
		$statement->execute();
		$result = $statement->fetch_assoc();
		return $result;
	}
910922
public function getCreateTableSql($table)
    {
        $table = $this->buildRealTableName($table);
        return $this->getSchema()->getCreateTableSql($table);
    }