------------------------------------------------------ update columns
434320
@Override
    public void updateDeployments(Iterable<Deployment> deployments) {
        Deployment oldDeployment = deploymentColumn.getSelectedItem();
        Deployment newDeployment = null;

        if (oldDeployment != null) {
            for (Deployment d : deployments) {
                if (d.getName().equals(oldDeployment.getName())) {
                    newDeployment = d;
                }
            }
        }
        deploymentColumn.updateFrom(Lists.newArrayList(deployments), newDeployment);
    }
897286
public void updateColumn(int c, TableColumn col)
    {
        int r = 0;
        while (r < getRowCount())
        {
            TableCellBox cell = cells[c][r];
            if (cell != null)
            {
            	cell.setOwnerColumn(col);
                //minimal width
                int min = cell.getMinimalWidth() / cell.getColspan();
                if (min > col.getMinimalWidth())
                    col.setMinimalWidth(min);
                //maximal width
                int max = cell.getMaximalWidth() / cell.getColspan();
                if (max > col.getMaximalWidth())
                    col.setMaximalWidth(max);
                //fixed width and percentages
                if (cell.wset) 
                {
                    col.wset = true;
                    if (cell.isRelative())
                    {
                        col.setRelative(true);
                        if (col.percent < cell.percent)
                            col.percent = cell.percent;
                    }
                    else
                    {
                        if (cell.getContentWidth() > col.abswidth)
                            col.abswidth = cell.getContentWidth();
                    }
                }
                //ensure the minimal width
                if (col.getWidth() < col.getMinimalWidth())
                    col.setColumnWidth(col.getMinimalWidth());
                r += cell.getRowspan();
            }
            else
                r++;
        }
    }
687931
def alter_change_column(self, table, column, field):
        """"""
        return self._update_column(table, column, lambda a, b: b)
410550
protected function _updateColumns ($table_name) {
		$primary_column_name = $this->query(sprintf('SHOW INDEX FROM %s WHERE Key_name = \'PRIMARY\'', $table_name))->fetch(\PDO::FETCH_ASSOC);
		$primary_column_name = isset($primary_column_name['Column_name']) ? $primary_column_name['Column_name'] : null;

		$pdo_param_list = $this->GetPdoParamList();

		$this->_columns[$table_name] = [];
		foreach ($this->query(sprintf('SHOW FULL COLUMNS FROM %s;', $table_name), \PDO::FETCH_ASSOC) as $columns) {
			$this->_columns[$table_name][$columns['Field']] = [
				'column_name'		=> $columns['Field'],
				'type'				=> $columns['Type'],
				'not_null'			=> filter_var($columns['Null'], \FILTER_VALIDATE_BOOLEAN),
				'default'			=> $columns['Default'],
				'auto_increment'	=> $columns['Extra'] === 'auto_increment',
				'primary_key'		=> $primary_column_name === $columns['Field'],
				'comment'			=> $columns['Comment'],
				'raw_data'			=> $columns,
				'pdo_param'			=> $pdo_param_list[explode('(', $columns['Type'])[0]],
			];
		}
	}
318477
def updateColumnValue(self, column, value, index=None):
        
        if index is None:
            index = self.treeWidget().column(column.name())
        
        if type(value) == datetime.date:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) == datetime.time:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) == datetime.datetime:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) in (float, int):
            if column.enum():
                self.setText(index, column.enum().displayText(value))
            else:
                self.setData(index, Qt.EditRole, wrapVariant(value))
        elif value is not None:
            self.setText(index, nativestring(value))
        else:
            self.setText(index, '')
        
        self.setSortData(index, value)
        
        # map default value information
        try:
            mapper = self.treeWidget().columnMappers().get(column.columnName())
        except AttributeError:
            mapper = None
        
        if mapper is None:
            form = column.stringFormat()
            if form:
                mapper = form.format
        
        if mapper:
            self.setText(index, mapper(value))
183522
function set_column_width($j, $width) {
    if ( $this->_columns_locked ) {
      return;
    }
    
    $col =& $this->get_column($j);
    $col["used-width"] = $width;
    $next_col =& $this->get_column($j+1);
    $next_col["x"] = $next_col["x"] + $width;
  }
1167252
def update(self, frame_no):
        
        for column in self._columns:
            for widget in column:
                widget.update(frame_no)
340621
@Override
	public void updateClob(final String columnLabel, final Clob x) throws SQLException {
		wrapped.updateClob(columnLabel, x);
	}
1294023
@Override
	public void updateArray(final int columnIndex, final Array x) throws SQLException {
		wrapped.updateArray(columnIndex, x);
	}
507511
public function addColumns($columns)
    {
        foreach ($columns as $name => $value) {
            try {
                $this->addColumn($name, $value);
            } catch (Exception $e) {
            }
        }

        if (!empty($e)) {
            throw $e;
        }
    }
279680
def UpdateColums(self, cursor, field, FieldType, model, columns, UNCHANGED):
        '''
        '''
        table = model.__name__.lower()
        if field not in columns:
            n = UNCHANGED.pop()
            new_sql = f"ALTER TABLE {table} ADD COLUMN {field} {FieldType} AFTER {n}"
            cursor.execute(new_sql)
            print("\n\n", new_sql)
        else:
            UNCHANGED.append(field)

        # We drop the fields in the table not in models
        TCOLS = set(columns)-set(model._fields)
        for col in TCOLS:
            columns.remove(col)
            QRY = f"ALTER TABLE {table} DROP COLUMN {col}"
            cursor.execute(QRY)
            print("\n\n", QRY)

        return True
626740
def rename_columns(self, col):
        
        try:
            self.cleaned_data.columns = col
        except Exception as e:
            raise e
1177057
function validateColumns(columns) {
  if (!columns) {
    return;
  }

  // check IDs
  var ids = {};
  columns.forEach(function (column, i) {
    var id = column.id;

    if (!ids[id]) {
      ids[id] = [i];
    } else {
      ids[id].push(i);
    }
  });
  Object.keys(ids).forEach(function (id) {
    if (ids[id].length > 1) {
      console.warn('Column ID \'' + id + '\' used in multiple columns ' + ids[id].join(', '), ids[id].map(function (index) {
        return columns[index];
      }));
    }
  });
}
449936
function update($id, $save_cols)
    {
        $record = $this->get_record($id, true);

        $newdata     = array();
        $replacedata = array();
        $deletedata  = array();
        $subdata     = array();
        $subdeldata  = array();
        $subnewdata  = array();

        $ldap_data = $this->_map_data($save_cols);
        $old_data  = $record['_raw_attrib'];

        // special handling of photo col
        if ($photo_fld = $this->fieldmap['photo']) {
            // undefined means keep old photo
            if (!array_key_exists('photo', $save_cols)) {
                $ldap_data[$photo_fld] = $record['photo'];
            }
        }

        foreach ($this->fieldmap as $fld) {
            if ($fld) {
                $val = $ldap_data[$fld];
                $old = $old_data[$fld];
                // remove empty array values
                if (is_array($val))
                    $val = array_filter($val);
                // $this->_map_data() result and _raw_attrib use different format
                // make sure comparing array with one element with a string works as expected
                if (is_array($old) && count($old) == 1 && !is_array($val)) {
                    $old = array_pop($old);
                }
                if (is_array($val) && count($val) == 1 && !is_array($old)) {
                    $val = array_pop($val);
                }
                // Subentries must be handled separately
                if (!empty($this->prop['sub_fields']) && isset($this->prop['sub_fields'][$fld])) {
                    if ($old != $val) {
                        if ($old !== null) {
                            $subdeldata[$fld] = $old;
                        }
                        if ($val) {
                            $subnewdata[$fld] = $val;
                        }
                    }
                    else if ($old !== null) {
                        $subdata[$fld] = $old;
                    }
                    continue;
                }

                // The field does exist compare it to the ldap record.
                if ($old != $val) {
                    // Changed, but find out how.
                    if ($old === null) {
                        // Field was not set prior, need to add it.
                        $newdata[$fld] = $val;
                    }
                    else if ($val == '') {
                        // Field supplied is empty, verify that it is not required.
                        if (!in_array($fld, $this->prop['required_fields'])) {
                            // ...It is not, safe to clear.
                            // #1488420: Workaround "ldap_mod_del(): Modify: Inappropriate matching in..."
                            // jpegPhoto attribute require an array() here. It looks to me that it works for other attribs too
                            $deletedata[$fld] = array();
                            //$deletedata[$fld] = $old_data[$fld];
                        }
                    }
                    else {
                        // The data was modified, save it out.
                        $replacedata[$fld] = $val;
                    }
                } // end if
            } // end if
        } // end foreach

        // console($old_data, $ldap_data, '----', $newdata, $replacedata, $deletedata, '----', $subdata, $subnewdata, $subdeldata);

        $dn = self::dn_decode($id);

        // Update the entry as required.
        if (!empty($deletedata)) {
            // Delete the fields.
            if (!$this->ldap->mod_del($dn, $deletedata)) {
                $this->set_error(self::ERROR_SAVING, 'errorsaving');
                return false;
            }
        } // end if

        if (!empty($replacedata)) {
            // Handle RDN change
            if ($replacedata[$this->prop['LDAP_rdn']]) {
                $newdn = $this->prop['LDAP_rdn'].'='
                    .rcube_ldap_generic::quote_string($replacedata[$this->prop['LDAP_rdn']], true)
                    .','.$this->base_dn;
                if ($dn != $newdn) {
                    $newrdn = $this->prop['LDAP_rdn'].'='
                    .rcube_ldap_generic::quote_string($replacedata[$this->prop['LDAP_rdn']], true);
                    unset($replacedata[$this->prop['LDAP_rdn']]);
                }
            }
            // Replace the fields.
            if (!empty($replacedata)) {
                if (!$this->ldap->mod_replace($dn, $replacedata)) {
                    $this->set_error(self::ERROR_SAVING, 'errorsaving');
                    return false;
                }
            }
        } // end if

        // RDN change, we need to remove all sub-entries
        if (!empty($newrdn)) {
            $subdeldata = array_merge($subdeldata, $subdata);
            $subnewdata = array_merge($subnewdata, $subdata);
        }

        // remove sub-entries
        if (!empty($subdeldata)) {
            foreach ($subdeldata as $fld => $val) {
                $subdn = $fld.'='.rcube_ldap_generic::quote_string($val).','.$dn;
                if (!$this->ldap->delete_entry($subdn)) {
                    return false;
                }
            }
        }

        if (!empty($newdata)) {
            // Add the fields.
            if (!$this->ldap->mod_add($dn, $newdata)) {
                $this->set_error(self::ERROR_SAVING, 'errorsaving');
                return false;
            }
        } // end if

        // Handle RDN change
        if (!empty($newrdn)) {
            if (!$this->ldap->rename($dn, $newrdn, null, true)) {
                $this->set_error(self::ERROR_SAVING, 'errorsaving');
                return false;
            }

            $dn    = self::dn_encode($dn);
            $newdn = self::dn_encode($newdn);

            // change the group membership of the contact
            if ($this->groups) {
                $group_ids = $this->get_record_groups($dn);
                foreach (array_keys($group_ids) as $group_id) {
                    $this->remove_from_group($group_id, $dn);
                    $this->add_to_group($group_id, $newdn);
                }
            }

            $dn = self::dn_decode($newdn);
        }

        // add sub-entries
        if (!empty($subnewdata)) {
            foreach ($subnewdata as $fld => $val) {
                $subdn = $fld.'='.rcube_ldap_generic::quote_string($val).','.$dn;
                $xf = array(
                    $fld => $val,
                    'objectClass' => (array) $this->prop['sub_fields'][$fld],
                );
                $this->ldap->add_entry($subdn, $xf);
            }
        }

        return $newdn ?: true;
    }
650691
def addColumn(self, column):
        
        column.setSchema(self)
        self.__columns[column.name()] = column
85713
function adjustColumnIndex( $columnIndex, $newColumnIndex )
    {
        $matrix = $this->attribute( 'matrix' );
        $columnDefinition = $matrix['columns']['sequential'][$columnIndex];
        if ( $columnDefinition['index'] != $newColumnIndex )
        {
            $this->setColumnIndex( $columnIndex, $newColumnIndex );
            return true;
        }
        return false;
    }
933775
public function updateStampColumns($subset = null)
    {
        $columns = self::normalizeColumnList(static::STAMP_COLUMNS, 'datetime');
        if ($subset !== null) {
            $columns = Utils::arrayWhitelist($columns, (array) $subset);
        }
        $columns = Utils::arrayBlacklist($columns, array_keys($this->changes));

        $stamp = explode(' ', static::getCurrentTimestamp());

        foreach ($columns as $column => $mode) {
            switch ($mode) {
                case 'auto':
                    break;

                case 'date':
                    $this->__set($column, $stamp[0]);
                    break;

                case 'time':
                    $this->__set($column, $stamp[1]);
                    break;

                case 'datetime':
                    $this->__set($column, implode(' ', $stamp));
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s (`%s`) has invalid STAMP_COLUMNS mode: '%s'",
                        static::class,
                        $column,
                        $mode
                    ));
                    break;
            }
        }
    }