Returns a column's full name i.e. table.column

@param string $col The column's name (escaped or not)
@param null|string $table The table's name (escaped or not)
@param bool $escaped If set to true the returned string will be escaped
@return null|string
334034
public function col_full_name(string $col, $table = null, $escaped = false): ?string
  {
    if ( $col = trim($col) ){
      $bits = explode('.', str_replace($this->qte, '', $col));
      $ok = null;
      $col = array_pop($bits);
      if ( $table && ($table = $this->table_simple_name($table)) ){
        $ok = 1;
      }
      else if ( \count($bits) ){
        $table = array_pop($bits);
        $ok = 1;
      }
      if ( (null !== $ok) && bbn\str::check_name($table, $col) ){
        return $escaped ? '"'.$table.'"."'.$col.'"' : $table.'.'.$col;
      }
    }
		return null;
  }
473090
protected function compileColumnName(string $column): string
	{
		if($this->hasJsonPath($column))
		{
			$segments = explode(static::JSON_PATH_SEPARATOR, $column);

			$column = $this->escapeColumn(array_shift($segments));

			return $this->buildJsonGet($column, $segments);
		}

		return $this->escapeColumn($column);
	}
65711
protected function prepareColumns($columns)
    {
        $prefix = DataQuery::applyRelationPrefix($this->relation);
        $table = DataObject::getSchema()->tableForField($this->model, current($columns));
        $fullTable = $prefix . $table;
        $columns = array_map(function ($col) use ($fullTable) {
            return "\"{$fullTable}\".\"{$col}\"";
        }, $columns);
        return implode(',', $columns);
    }
8642
private function columnName($column)
    {
        // Select all
        if ($column == '*') {
            return "`{$this->query['table']}`.*";
        }

        if (strpos($column, '.') === false) {
            $column = $this->query['table'] . ".{$column}";
        }

        // Regular column name
        if (strpos($column, '(') === false) {
            return str_replace(array('.'), array('`.`'), "`{$column}`");
        } else {
            return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');
        }
    }
840373
public function escapeColumn(string $column): string
	{
		$segments = [];

		foreach(explode('.', $column) as $segment)
		{
			if($segment === '*')
			{
				$segments[] = $segment;
			}
			else
			{
				$segments[] = $this->escapeIdentifier($segment);
			}
		}

		return implode('.', $segments);
	}
1172732
protected function prefixTable($table, bool $escape = true): string {
        if ($table instanceof Identifier) {
            return $escape ? $table->escape($this) : (string)$table;
        } else {
            $table = $this->px.$table;
            return $escape ? $this->escape($table) : $table;
        }
    }
1073471
protected function findColumns($table)
	{
		$sql='SHOW FULL COLUMNS FROM '.$table->rawName;
		try
		{
			$columns=$this->getDbConnection()->createCommand($sql)->queryAll();
		}
		catch(Exception $e)
		{
			return false;
		}
		foreach($columns as $column)
		{
			$c=$this->createColumn($column);
			$table->columns[$c->name]=$c;
			if($c->isPrimaryKey)
			{
				if($table->primaryKey===null)
					$table->primaryKey=$c->name;
				elseif(is_string($table->primaryKey))
					$table->primaryKey=array($table->primaryKey,$c->name);
				else
					$table->primaryKey[]=$c->name;
				if($c->autoIncrement)
					$table->sequenceName='';
			}
		}
		return true;
	}
95687
protected static function getBooleanAccessorName(Column $column)
    {
        $name = $column->getCamelCaseName();
        if (!preg_match('/^(?:is|has)(?=[A-Z])/', $name)) {
            $name = 'is' . ucfirst($name);
        }
        return $name;
    }
216708
public function getColumnDefaultValueDDL(Column $col)
    {
        $default = '';
        $defaultValue = $col->getDefaultValue();
        if (null !== $defaultValue) {
            $default .= 'DEFAULT ';
            if ($defaultValue->isExpression()) {
                $default .= $defaultValue->getValue();
            } else {
                if ($col->isTextType()) {
                    $default .= $this->quote($defaultValue->getValue());
                } elseif (in_array($col->getType(), [PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU])) {
                    $default .= $this->getBooleanString($defaultValue->getValue());
                } elseif ($col->getType() == PropelTypes::ENUM) {
                    $default .= array_search($defaultValue->getValue(), $col->getValueSet());
                } elseif ($col->isSetType()) {
                    $val = trim($defaultValue->getValue());
                    $values = [];
                    foreach (explode(',', $val) as $v) {
                        $values[] = trim($v);
                    }
                    $default .= SetColumnConverter::convertToInt($values, $col->getValueSet());
                } elseif ($col->isPhpArrayType()) {
                    $value = $this->getPhpArrayString($defaultValue->getValue());
                    if (null === $value) {
                        $default = '';
                    } else {
                        $default .= $value;
                    }
                } else {
                    $default .= $defaultValue->getValue();
                }
            }
        }

        return $default;
    }
228351
public function col_simple_name(string $col, bool $escaped=false): ?string
  {
    if ( $col = trim($col) ){
      $bits = explode('.', str_replace($this->qte, '', $col));
      $col = end($bits);
      if ( bbn\str::check_name($col) ){
        return $escaped ? $this->qte.$col.$this->qte : $col;
      }
    }
    return null;
  }
790469
protected function quoteTable($table)
    {
        # The odbc sql only uses it's quote strings for renaming fields, not for quoting table/field names
        if ($this->mode == "odbc") {
            return $table;
        }

        $table = trim($table);

        # There is a standard function for quoting postgres table names
        if (in_array($this->mode, ["postgres", "redshift"], true)) {
            $this->connect();
            return pg_escape_identifier($this->server, $table);
        }

        $chars = $this->quoteChars[$this->mode];

        if (is_array($chars)) {
            $from = $chars[0];
            $to = $chars[1];
        } else {
            $from = $chars;
            $to = $chars;
        }

        $quoted = $from . $table . $to;

        return $quoted;
    }
736671
public String escapeColumnName(String columnName) {
		StringBuilder sb = new StringBuilder(columnName.length() + 4);
		databaseType.appendEscapedEntityName(sb, columnName);
		return sb.toString();
	}
383500
protected function getTableFullName()
    {
        $prefix = !empty($this->tablePrefix) && is_string($this->tablePrefix) ? $this->tablePrefix . '_' : '';
        return $prefix . $this->tableName;
    }
669957
final public function getFieldType(string $table, string $column): string
    {
        /* @noinspection PhpUnhandledExceptionInspection */
        return $this->getColumnsMetadata($table)['fieldTypes'][$column];
    }
1168082
public function FormatTableName($Table) {

      if (strpos($Table, '.') !== FALSE){
         if(preg_match('/^([^\s]+)\s+(?:as\s+)?`?([^`]+)`?$/', $Table, $Matches)){
            $DatabaseTable = '`' . str_replace('.', '`.`', $Matches[1]) . '`';
            $Table = str_replace($Matches[1], $DatabaseTable, $Table);
         }else
            $Table = '`' . str_replace('.', '`.`', $Table) . '`';
      }
      return $Table;
   }
1064907
public function escapeTable(string $table): string
	{
		$segments = [];

		foreach(explode('.', $table) as $segment)
		{
			$segments[] = $this->escapeIdentifier($segment);
		}

		return implode('.', $segments);
	}
133098
protected function getColumnSqlDefinition(Column $column)
    {
        if ($column->getType() instanceof Literal) {
            $def = (string)$column->getType();
        } else {
            $sqlType = $this->getSqlType($column->getType(), $column->getLimit());
            $def = strtoupper($sqlType['name']);
        }
        if ($column->getPrecision() && $column->getScale()) {
            $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')';
        } elseif (isset($sqlType['limit'])) {
            $def .= '(' . $sqlType['limit'] . ')';
        }
        if (($values = $column->getValues()) && is_array($values)) {
            $def .= "('" . implode("', '", $values) . "')";
        }
        $def .= $column->getEncoding() ? ' CHARACTER SET ' . $column->getEncoding() : '';
        $def .= $column->getCollation() ? ' COLLATE ' . $column->getCollation() : '';
        $def .= (!$column->isSigned() && isset($this->signedColumnTypes[$column->getType()])) ? ' unsigned' : '';
        $def .= ($column->isNull() == false) ? ' NOT NULL' : ' NULL';
        $def .= $column->isIdentity() ? ' AUTO_INCREMENT' : '';
        $def .= $this->getDefaultValueDefinition($column->getDefault(), $column->getType());

        if ($column->getComment()) {
            $def .= ' COMMENT ' . $this->getConnection()->quote($column->getComment());
        }

        if ($column->getUpdate()) {
            $def .= ' ON UPDATE ' . $column->getUpdate();
        }

        return $def;
    }