Returns the SQL clause for creating a column in a table alteration.

@param Column $column The column to add.

@return string
10538
protected function getAlterTableAddColumnClause(Column $column)
    {
        return 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
    }
1125473
public function addTablePrefixToColumn(string $column): string
    {
        return ($this->tablePrefixer ?? $this->database->getTablePrefixer())->addTablePrefixToColumn($column);
    }
833674
public function addColumnObject($column)
    {
        $name = $column->getName();

        $this->forbidColumn($name);

        $sql = 'ADD COLUMN ';
        $sql .= $this->_database->prepareIdentifier($name);
        $sql .= ' ';
        $sql .= $column->getDefinition();

        $this->alter($sql);

        // Update column cache
        $this->_columns[$name] = $column;
        $this->_columns[$name]->setTable($this);
        return $this->_columns[$name];
    }
166384
public function getColumnDefinition(ColumnInterface $column)
    {
        $sql = parent::getColumnDefinition($column);
        if ($column instanceof Column && $column->getComment()) {
            $sql .= " COMMENT \"" . addcslashes($column->getComment(), '"') . "\"";
        }
        $def = $column->getDefault();
        // empty value will ignore when create table
        if (isset($def) && in_array($def, [0, '', '0'])) {
            $sql .= ' DEFAULT "' . $def . '"';
        }
        if ($column->getType() == Column::TYPE_INTEGER
            && $column->getSize() == 4) {
            $sql = preg_replace('/^INT/', 'TINYINT', $sql);
        }
        return $sql;
    }
280627
public function getColumnId( $column )
    {
        if ( $this->getColumnsUseTranslation() )
        {
            $translatePrefix    = $this->getColumnTranslatePrefix();
            $translatePostfix   = $this->getColumnTranslatePostfix();

            $column = ( empty( $translatePrefix )
                        ? '' : $translatePrefix . '.' ) .
                      $column .
                      ( empty( $translatePostfix )
                        ? '' : '.' . $translatePostfix );
        }

        return $column;
    }
116677
protected function getColumnSqlDefinition(Column $column)
    {
        $buffer = [];
        if ($column->isIdentity()) {
            $buffer[] = $column->getType() == 'biginteger' ? 'BIGSERIAL' : 'SERIAL';
        } elseif ($column->getType() instanceof Literal) {
            $buffer[] = (string)$column->getType();
        } else {
            $sqlType = $this->getSqlType($column->getType(), $column->getLimit());
            $buffer[] = strtoupper($sqlType['name']);

            // integers cant have limits in postgres
            if (static::PHINX_TYPE_DECIMAL === $sqlType['name'] && ($column->getPrecision() || $column->getScale())) {
                $buffer[] = sprintf(
                    '(%s, %s)',
                    $column->getPrecision() ?: $sqlType['precision'],
                    $column->getScale() ?: $sqlType['scale']
                );
            } elseif (in_array($sqlType['name'], ['geography'])) {
                // geography type must be written with geometry type and srid, like this: geography(POLYGON,4326)
                $buffer[] = sprintf(
                    '(%s,%s)',
                    strtoupper($sqlType['type']),
                    $sqlType['srid']
                );
            } elseif (in_array($sqlType['name'], ['time', 'timestamp'])) {
                if (is_numeric($column->getPrecision())) {
                    $buffer[] = sprintf('(%s)', $column->getPrecision());
                }

                if ($column->isTimezone()) {
                    $buffer[] = strtoupper('with time zone');
                }
            } elseif (!in_array($sqlType['name'], ['integer', 'smallint', 'bigint', 'boolean'])) {
                if ($column->getLimit() || isset($sqlType['limit'])) {
                    $buffer[] = sprintf('(%s)', $column->getLimit() ?: $sqlType['limit']);
                }
            }
        }

        $buffer[] = $column->isNull() ? 'NULL' : 'NOT NULL';

        if (!is_null($column->getDefault())) {
            $buffer[] = $this->getDefaultValueDefinition($column->getDefault(), $column->getType());
        }

        return implode(' ', $buffer);
    }
369846
public function getColumn($column) {
		if ($this->columns->has($column)) {
			return $this->columns[$column];
		}

		throw new ColumnException('Column not found!');
	}
43122
protected function _changedColumnsStatement()
    {
        $columns = $this->_sql->getChangedColumns();
        if (empty($columns)) {
            return null;
        }

        return $this->_parseChangedColumns();
    }
399265
public function addColumn(Column $column)
    {
        $this->columns[] = $column;

        if ($column instanceof ColumnInterface) {
            $column->initialize($this);
        }

        return $this;
    }
1076024
public function getSelectionColumn($column)
        {
            if (isset($this->selections[$column])) {
                return $this->selections[$column]->getColumn();
            }

            foreach ($this->selections as $selection) {
                if ($selection->getAlias() == $column) {
                    return $column;
                }
            }

            list($table_name, $column_name) = (strpos($column, '.') !== false) ? explode('.', $column) : [$this->table->getB2DBName(), $column];

            if ($this->table->getB2DBAlias() == $table_name || $this->table->getB2DBName() == $table_name) {
                return $this->table->getB2DBAlias() . '.' . $column_name;
            } elseif (isset($this->joins[$table_name])) {
                return $this->joins[$table_name]->getTable()->getB2DBAlias() . '.' . $column_name;
            }

            foreach ($this->joins as $join) {
                if ($join->getTable()->getB2DBName() == $table_name) {
                    return $join->getTable()->getB2DBAlias() . '.' . $column_name;
                }
            }

            throw new Exception("Couldn't find table name '{$table_name}' for column '{$column_name}', column was '{$column}'. If this is a column from a foreign table, make sure the foreign table is joined.");
        }
518508
public function whereNull($column) {
		// secure the column name
		list(
			$column, 
			$placeholder
		) = Convert::columnToPlaceholder($this->Quote ,$column);
		// save the condition
		$this->Conditions[] = "{$this->Operator} ( {$column} IS NULL )";
		// add the empty value
		$this->Values[":empty_{$placeholder}"] = '';
		// return self to the next method
		return $this;
	}
1094258
public function column($column)
    {
        $result = $this->fields($column)->one(); 

        // only return something if something is found
        if (is_array($result))
        {
            return reset($result);
        }
    }
1036010
public function getColumn($column = 0)
    {
        $this->parseDefer();
        if(!$this->isSuccess)
        {
            throw new \RuntimeException('Result is not success!');
        }
        return $this->statement->fetchAll(\PDO::FETCH_COLUMN, $column);
    }
288186
protected function getColumnSqlDefinition(Column $column)
    {
        $buffer = [];
        if ($column->isIdentity()) {
            $buffer[] = $column->getType() === 'biginteger' ? 'BIGSERIAL' : 'SERIAL';
        } else {
            $sqlType = $this->getSqlType($column->getType(), $column->getLimit());
            $buffer[] = \strtoupper($sqlType['name']);
            // integers cant have limits in postgres
            if (static::PHINX_TYPE_DECIMAL === $sqlType['name'] && ($column->getPrecision() || $column->getScale())) {
                $buffer[] = \sprintf(
                    '(%s, %s)',
                    $column->getPrecision() ?: $sqlType['precision'],
                    $column->getScale() ?: $sqlType['scale']
                );
            } elseif ($sqlType['name'] === 'geography') {
                // geography type must be written with geometry type and srid, like this: geography(POLYGON,4326)
                $buffer[] = \sprintf(
                    '(%s,%s)',
                    \strtoupper($sqlType['type']),
                    $sqlType['srid']
                );
            } elseif (!\in_array($sqlType['name'], ['integer', 'smallint', 'bigint'], true)) {
                if ($column->getLimit() || isset($sqlType['limit'])) {
                    $buffer[] = sprintf('(%s)', $column->getLimit() ?: $sqlType['limit']);
                }
            }

            $timeTypes = [
                'time',
                'timestamp',
            ];
            if (in_array($sqlType['name'], $timeTypes) && $column->isTimezone()) {
                $buffer[] = strtoupper('with time zone');
            }
        }

        $buffer[] = $column->isNull() ? 'NULL' : 'NOT NULL';

        if (null !== $column->getDefault()) {
            $buffer[] = $this->getDefaultValueDefinition($column->getDefault());
        }

        return implode(' ', $buffer);
    }
1165167
public function selectColumn(string $column, ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->column($column, $alias);

        return $instance;
    }
171070
private function prepareColumn(array $column)
    {
        if ($column['sql'] instanceof self) {
            [$sql, $params] = $column['sql']->toSql();

            $column['sql'] = '(' . $sql . ')';

            $column['params'] = $params;
        }

        return $column;
    }
914838
public function getDoctrineColumn($table, $column)
    {
        $schema = $this->getDoctrineSchemaManager();

        return $schema->listTableDetails($table)->getColumn($column);
    }