Nette\Database\Drivers\MySqlDriver::getColumns PHP Method

getColumns() public method

Returns metadata for all columns in a table.
public getColumns ( $table )
    public function getColumns($table)
    {
        $columns = [];
        foreach ($this->connection->query('SHOW FULL COLUMNS FROM ' . $this->delimite($table)) as $row) {
            $type = explode('(', $row['Type']);
            $columns[] = ['name' => $row['Field'], 'table' => $table, 'nativetype' => strtoupper($type[0]), 'size' => isset($type[1]) ? (int) $type[1] : NULL, 'unsigned' => (bool) strstr($row['Type'], 'unsigned'), 'nullable' => $row['Null'] === 'YES', 'default' => $row['Default'], 'autoincrement' => $row['Extra'] === 'auto_increment', 'primary' => $row['Key'] === 'PRI', 'vendor' => (array) $row];
        }
        return $columns;
    }