@param $table
@param string $column

@return array
323581
public static function getColumnsComments($table, $column = ''): array
    {
        return self::q_assoc('SELECT
COLUMN_COMMENT, COLUMN_NAME
FROM
    INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = "' . Configuration::getInstance()->get('db')['name'] . '"
AND TABLE_NAME = "' . self::sql_prepare($table) . '"
' . ($column ? 'AND COLUMN_NAME = "' . self::sql_prepare($column) . '"' : '') . ''
        );
    }
426994
public function getEntityField($table, $column)
    {
        $class = $this->getEntityClass($table);
        /** @var Entity $entity */
        $entity = new $class;
        $reflection = $entity->getReflection($this);
        foreach ($reflection->getEntityProperties() as $property) {
            if ($property->getColumn() == $column) {
                return Utils::underscoreToCamel($property->getName());
            }
        }
        throw new InvalidArgumentException(sprintf("Could not find property for table '%s' and column '%s'", $table, $column));
    }
914838
public function getDoctrineColumn($table, $column)
    {
        $schema = $this->getDoctrineSchemaManager();

        return $schema->listTableDetails($table)->getColumn($column);
    }
1039949
public function getColumnValues($column)
    {
        if ($column >= $this->columns) {
            throw MatrixException::columnOutOfRange();
        }

        return array_column($this->matrix, $column);
    }
1320960
public function columns($column = null)
	{
		if($column !== null)
		{
			$this->select([$column]);
		}

		$query = $this->compiler->select();

		return $this->connection->columns($query['sql'], $query['params']);
	}
1104309
public function values($column) {
		$res = [];
		while($row = $this->next())
			$res[] = $row[$column];
		return $res;
	}
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;
	}
407775
protected function getFieldByColumn($column)
    {
        return $this->builder->fields()->first(
            function (Field $field) use ($column) {
                if (is_array($field->column())) {
                    return in_array($column, $field->column(), true);
                }

                return $field->column() === $column;
            }
        );
    }
55935
public function getColumns($table)
    {
        $table = $this->prefixTable($table);

        if (empty($this->queriesResultCache[ 'tableColumns' ][ $table ])) {
            $result = $this->query('PRAGMA TABLE_INFO(' . $this->protectIdentifiers($table, true, null, false) . ')');

            if ($result->count()) {
                foreach ($result as $row) {
                    // Do we know from where to get the column's name?
                    if ( ! isset($key)) {
                        if (isset($row[ 'name' ])) {
                            $key = 'name';
                        }
                    }

                    $this->queriesResultCache[ 'tableColumns' ][ $table ][ $row->offsetGet($key) ] = $row;
                }
            }
        }

        return $this->queriesResultCache[ 'tableColumns' ][ $table ];
    }
192680
protected function generateColumns($table)
    {
        $columns = [];
        $needPK = true;
        foreach ($table->columns as $column) {
            if ($column->autoIncrement) {
                $columns[$column->name] = $column->type == Schema::TYPE_BIGINT ? '$this->bigPrimaryKey()' : '$this->primaryKey()';
                $needPK = false;
                continue;
            }
            $columns[$column->name] = $this->getSchemaType($column);
        }
        if ($needPK && !empty($table->primaryKey)) {
            $pks = implode(']], [[', $table->primaryKey);
            $columns[0] = "PRIMARY KEY ([[{$pks}]])";
        }

        return $columns;
    }
923344
public function hasColumns($table, array $columns)
    {
        $tableColumns = array_map('strtolower', array_keys($this->getColumnListing($table)));

        foreach ($columns as $column) {
            if (!in_array(strtolower($column), $tableColumns)) {
                return false;
            }
        }

        return true;
    }
320207
protected function getListSelect($column, $key)
    {
        $select = is_null($key) ? array($column) : array($column, $key);

        if (($dot = strpos($select[0], '.')) !== false) {
            $select[0] = substr($select[0], $dot + 1);
        }

        return $select;
    }
1250983
public function getColumns( $table ) {
		$table = $this->safeTable($table);
		$columnsRaw = $this->adapter->get("DESCRIBE $table");
		foreach($columnsRaw as $r) {
			$columns[$r['Field']]=$r['Type'];
		}
		return $columns;
	}
35050
public function getTableColumns($table)
    {
        $driver = $this->getDriverName();
        $bind = [];
        if ($driver == 'sqlite') {
            $table = $this->quoteIdentifiers($table);
            $sql = 'PRAGMA table_info(' . $table . ');';
            $key = 'name';
        } elseif ($driver == 'mysql') {
            $table = $this->quoteIdentifiers($table);
            $sql = 'DESCRIBE ' . $table . ';';
            $key = 'Field';
        } else {
            $bind[] = $table;
            $sql = 'SELECT column_name FROM information_schema.columns WHERE ';
            if($driver == 'pgsql'){
                $bind = explode('.', $table, 2);
                if(count($bind) == 2){
                    $sql.='table_schema = ? AND ';
                }
            }
            $sql.='table_name = ? ;';
            $key = 'column_name';
        }

        $fields = [];
        if (is_array($list = $this->run($sql, $bind, false))) {
            foreach ($list as $record) {
                $fields[] = $record[$key];
            }
            return $fields;
        }
        return $fields;
    }
816733
protected function generateColumns($table)
    {
        $columns = [];
        $needPK = true;
        foreach ($table->columns as $column) {
            if ($column->autoIncrement) {
                $columns[$column->name] = $column->type == Schema::TYPE_BIGINT ? 'Schema::TYPE_BIGPK' : 'Schema::TYPE_PK';
                $needPK = false;
                continue;
            }
            list($type, $extra) = $this->getSchemaType($column);
            $quote = "'";
            if (!$column->allowNull) {
                $extra .= ' NOT NULL';
            }

            if ($column->defaultValue !== null) {
                $extra .= ' DEFAULT ';
                if ($column->defaultValue instanceof Expression || is_numeric($column->defaultValue)) {
                    $extra .= $column->defaultValue;
                } else {
                    $extra .= "'{$column->defaultValue}'";
                    $quote = '"';
                }
            }

            if (!empty($extra)) {
                $type = "$type . {$quote}$extra{$quote}";
            }
            $columns[$column->name] = $type;
        }
        if ($needPK && !empty($table->primaryKey)) {
            $pks = implode(']], [[', $table->primaryKey);
            $columns[0] = "PRIMARY KEY ([[{$pks}]])";
        }

        return $columns;
    }
881792
public function getDefaultConstraintDeclarationSQL($table, array $column)
    {
        if (! isset($column['default'])) {
            throw new InvalidArgumentException("Incomplete column definition. 'default' required.");
        }

        $columnName = new Identifier($column['name']);

        return ' CONSTRAINT ' .
            $this->generateDefaultConstraintName($table, $column['name']) .
            $this->getDefaultValueDeclarationSQL($column) .
            ' FOR ' . $columnName->getQuotedName($this);
    }
1066940
public function flatten($column) {
        $out = array();
        foreach ($this as $row) {
            $out[] = $row->flatten($column);
        }
        return $out;
    }