Alias for Dabble\Adapter::column for consistency with PDO.
512444
public function fetchColumn($table, $field, $where = null, $options = null)
    {
        return $this->column($table, $field, $where, $options);
    }
1117568
public function pluck($column, $key = null)
    {
        return parent::pluck(
            $this->getColumnName($column),
            $key
        );
    }
251532
public function pluck($column) {

		$plucked = [];

		while(parent :: valid()) {
            
            $current = parent :: current();

            if(true === is_array($column)) {

            	$tmp = $current;
            	$insert = true;

            	foreach($column as $index) {

            		if(false === isset($tmp[$index])) {
            			
            			$insert = false;
            			break;
            		}

            		$tmp = $tmp[$index];
            	}

            	if(true === $insert) {
            		$plucked[] = $tmp;
            	}
            }

            if(true === isset($current[$column])) {
            	$plucked[] = $current[$column];
            }

            parent :: next();
        }

        switch($this -> convert) {

			case self :: TYPE_ARRAY: return $plucked;
			case self :: TYPE_OBJECT: return (object) $plucked;
			case self :: TYPE_JSON: return json_encode($plucked);
		}
	}
1139711
public function fixTablePrefixForDcMultilingual(string $table, &$columns, array &$options = [])
    {
        if (!$this->container->get('huh.utils.dca')->isDcMultilingual($table)) {
            return $columns;
        }

        if (\is_array($columns)) {
            $fixed = [];

            foreach ($columns as $column) {
                $fixed[] = str_replace($table.'.', 't1.', $column);
            }

            $columns = $fixed;
        } else {
            $columns = str_replace($table.'.', 't1.', $columns);
        }

        if (\is_array($options) && isset($options['order'])) {
            $options['order'] = str_replace($table.'.', 't1.', $options['order']);
        }
    }
944110
protected function prepareColumn(Column $column)
    {
        $typeMapper = $this->getDataType();

        $type = $typeMapper::getType($column->getType());
        $length = $column->getLength() ?: $typeMapper::getLength($type);

        $length = $length ? '(' . $length . ')' : null;

        $column->type($type);

        // Prepare default value
        $this->prepareDefaultValue($column);

        return $column->length($length);
    }
531641
public function column($index = 0)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetchAll(PDO::FETCH_COLUMN, $index);
        } else {
            return false;
        }
    }
463612
public function columns(array $fields) : self
    {
        foreach ($fields as $k => $v) {
            if (strpos($v, '*') !== false) {
                $temp = explode('.', $v);
                if (count($temp) === 1) {
                    $table = $this->definition->getName();
                    $cols = $this->definition->getColumns();
                } else if (count($temp) === 2) {
                    $table = $temp[0];
                    if ($this->definition->hasRelation($table)) {
                        $cols = $this->definition->getRelation($table)->table->getColumns();
                    } else if (isset($this->joins[$table])) {
                        $cols = $this->joins[$table]->table->getColumns();
                    } else {
                        throw new DBException('Invalid foreign table name');
                    }
                } else {
                    array_pop($temp);
                    $this->with(implode('.', $temp));
                    $table = array_reduce(
                        $temp,
                        function ($carry, $item) use (&$table) {
                            return $table->getRelation($item)->table;
                        }
                    );
                    $cols = $table->getColumns();
                    $table = implode(static::SEP, $temp);
                }
                unset($fields[$k]);
                foreach ($cols as $col) {
                    $fields[] = $table . '.' . $col;
                }
            }
        }
        $primary = $this->definition->getPrimaryKey();
        foreach ($fields as $k => $v) {
            try {
                $fields[$k] = $this->getColumn($v)['name'];
            } catch (DBException $e) {
                $fields[$k] = $v;
            }
        }
        foreach ($primary as $field) {
            $field = $this->getColumn($field)['name'];
            if (!in_array($field, $fields)) {
                $fields[] = $field;
            }
        }
        $this->fields = $fields;
        return $this;
    }
1035458
public function columnSql($column, $platform)
    {
        if ($this->_length <= 255) {
            return $platform->columnSql($column, "varchar({$this->_length})", $this->options());
        } elseif ($this->_length <= 65534) {
            return $platform->columnSql($column, "text", $this->options());
        } elseif ($this->_length <= 16777214) {
            return $platform->columnSql($column, "mediumtext", $this->options());
        } elseif ($this->_length <= 4294967294) {
            return $platform->columnSql($column, "longtext", $this->options());
        } else {
            throw new \BadMethodCallException("Unhandled string length of {$this->_length}");
        }
    }
1295086
private static function _loadColumns()
    {
        if (!self::resolveConnection()) {
            return;
        }

        $cls = get_called_class();
        self::$_columns[$cls] = array();

        $escape = Driver::$escape_char;

        // try to create the TORM info table
        $type = Driver::$numeric_column;

        // check if the torm table exists
        $rst   = null;
        $check = false;
        try {
            $rst   = self::query("select id from torm_info");
            $check = true;
        } catch (\Exception $e) {
        }

        // needs to create table
        if (!$check || !is_object($rst) || !$rst->fetch()) {
            $stmt = self::query("create table torm_info (id $type(1))");
            self::closeCursor($stmt);
        }
        if (is_object($rst)) {
            self::closeCursor($rst);
        }

        // insert first value
        $rst = self::query("select id from torm_info");
        if (!$rst->fetch()) {
            $stmt = self::query("insert into torm_info values (1)");
            self::closeCursor($stmt);
        }
        self::closeCursor($rst);

        // hack to dont need a query string to get columns
        $sql  = "select $escape".self::getTableName()."$escape.* from torm_info left outer join $escape".self::getTableName()."$escape on 1=1";
        $rst  = self::query($sql);
        $keys = array_keys($rst->fetch(\PDO::FETCH_ASSOC));

        foreach ($keys as $key) {
            $keyc = self::isIgnoringCase() ? strtolower($key) : $key;
            array_push(self::$_columns[$cls], $keyc);
            self::$_mapping[$cls][$keyc] = $key;
        }
        self::closeCursor($rst);
        self::$_loaded[$cls] = true;
    }
454989
def resolve_column(self, ref):
    ""
    if isinstance(ref, sqparse2.AttrX):
      if ref.parent.name not in self:
        raise ScopeUnkError('unk table or table alias', ref.parent.name)
      return ref.parent.name, ref.attr.name
    elif isinstance(ref, sqparse2.NameX):
      matches = set()
      for name, target in self.names.items():
        if isinstance(target, SyntheticTable):
          if ref.name in target.columns(self):
            matches.add(name)
        elif isinstance(target, table.Table):
          try: target.get_column(ref.name)
          except KeyError: pass
          else: matches.add(name)
        else:
          raise TypeError('expected SyntheticTable', type(target), target)
      if not matches: raise ScopeUnkError(ref)
      elif len(matches) > 1: raise ScopeCollisionError(matches, ref)
      else: return list(matches)[0], ref.name
    else:
      raise TypeError('unexpected', type(ref), ref)
720915
private function getColumnTypes(): void
  {
    $rows = DataLayer::getAllTableColumns();
    foreach ($rows as $row)
    {
      $key = '@'.$row['table_name'].'.'.$row['column_name'].'%type@';
      $key = strtoupper($key);

      $value = $row['column_type'];
      if (isset($row['character_set_name'])) $value .= ' character set '.$row['character_set_name'];

      $this->replacePairs[$key] = $value;
    }

    $this->io->text(sprintf('Selected %d column types for substitution', sizeof($rows)));
  }
1350656
public static function _generateSQLColumnFilter($column, $search_value, PDO $pdoLink, $sRangeSeparator = '~')
    {
        if (preg_match("/^\[(=|!=)\]$/i", $search_value, $match)) {
            return $column.' '.$match[1].' '.$pdoLink->quote('');
        }

        if (preg_match("/^\[(!|<=|>=|=|<|>|<>|!=)\](.+)/i", $search_value, $match)) {
            if ($match[1] == '!=' && $match[2] == 'null') {
                return $column.' IS NOT NULL';
            } elseif ($match[1] == '=' && $match[2] == 'null') {
                return $column.' IS NULL';
            } elseif ($match[1] == '!') {
                return $column.' NOT LIKE '.$pdoLink->quote('%'.$match[2].'%');
            } else {
                return $column.' '.$match[1].' '.$pdoLink->quote($match[2] == 'empty' ? '' : $match[2]);
            }
        } elseif (strpos($search_value, 'lenght:') === 0) {
            return 'CHAR_LENGTH('.$column.') = '.(int) substr($search_value, strlen('lenght:'));
        } elseif (strpos($search_value, 'reg:') === 0) { //&& $column['sFilter']['regex'] === true) {
            return $column.' REGEXP '.$pdoLink->quote(substr($search_value, strlen('reg:')));
        } elseif (preg_match('/(.*)(!?'.$sRangeSeparator.')(.*)/i', $search_value, $matches) && !empty($matches[1]) && !empty($matches[3])) {
            // TODO : use type to format the search value (eg STR_TO_DATE)
                return $column.($matches[2][0] == '!' ? ' NOT' : '')
                    .' BETWEEN '.$pdoLink->quote($matches[1]).' AND '.$pdoLink->quote($matches[3]);
        } elseif (strpos($search_value, 'in:') === 0) {
            $search_value = substr($search_value, strlen('in:'));

            return $column.' IN('.$search_value.')';
        } elseif (strpos($search_value, '!in:') === 0) {
            $search_value = substr($search_value, strlen('in:'));

            return $column.' NOT IN('.$search_value.')';
        } else {
            return $column.' LIKE '.$pdoLink->quote('%'.$search_value.'%');
        }
    }
1192662
public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = "			")
    {
        if ($column->getPDOType() == PropelTypes::CLOB_EMU) {
            return sprintf(
                "%s\$stmt->bindParam(%s, %s, %s, strlen(%s));
",
                $tab,
                $identifier,
                $columnValueAccessor,
                PropelTypes::getPdoTypeString($column->getType()),
                $columnValueAccessor
            );
        }

        return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab);
    }
472271
public function pluck($column, $key = null)
    {
        $results = $this->get(is_null($key) ? [$column] : [$column, $key]);
        // If the columns are qualified with a table or have an alias, we cannot use
        // those directly in the "pluck" operations since the results from the DB
        // are only keyed by the column itself. We'll strip the table out here.
        return array_pluck($results, $this->stripTableForPluck($column), $this->stripTableForPluck($key));
    }
948626
public function quote($value)
	{
		// PDO::quote() does not work as it should ...
		if ($value instanceof FlupdoRawSql) {
			return $value;
		} else if (is_bool($value)) {
			return $value ? 'TRUE' : 'FALSE';
		} else if (is_null($value)) {
			return 'NULL';
		} else if (is_int($value)) {
			return (string) $value;
		} else if (is_float($value)) {
			return sprintf('%F', $value);
		} else {
			// ignore locales when converting to string
			return $this->pdo->quote(strval($value), \PDO::PARAM_STR);
		}
	}
744808
public function columnSql($column, $platform)
    {
        $type = $this->width ? "bigint({$this->width})" : "bigint";

        return $platform->columnSql($column, $type, $this->options());
    }
316025
public function column($column, bool $allowAlias = false): string
	{
		if($column instanceof Raw)
		{
			return $this->raw($column);
		}
		elseif($column instanceof Subquery)
		{
			return $this->subquery($column);
		}
		elseif($allowAlias && stripos($column, ' AS ') !== false)
		{
			[$column, , $alias] = explode(' ', $column, 3);

			return sprintf('%s AS %s', $this->compileColumnName($column), $this->compileColumnName($alias));
		}

		return $this->compileColumnName($column);
	}