//NewColumn append new column in list with check by name of column
760028
func (c *Columns) NewColumn(name, caption string, width int, aling Align) (*Column, error) {
	if c.FindByName(name) != nil {
		return nil, ErrorAlreadyExists
	}
	column := &Column{
		Name:    name,
		Caption: caption,
		Width:   width,
		Aling:   aling,
		Visible: true,
	}
	c.columns = append(c.columns, column)
	return column, nil
}
585250
func fieldColumn(f reflect.StructField) string {
	if tag := f.Tag.Get("sql"); tag == "-" {
		return ""
	} else if tag != "" {
		return tag
	}
	return colname(f.Name)
}
1148544
func (t *Table) InsertColumn(column int) *Table {
	for row := range t.cells {
		if column >= len(t.cells[row]) {
			continue
		}
		t.cells[row] = append(t.cells[row], nil)             // Extend by one.
		copy(t.cells[row][column+1:], t.cells[row][column:]) // Shift to the right.
		t.cells[row][column] = &TableCell{}                  // New element is an uninitialized table cell.
	}
	return t
}
319622
func newFixedLenColumn(elemLen, cap int) *column {
	return &column{
		elemBuf:    make([]byte, elemLen),
		data:       make([]byte, 0, cap*elemLen),
		nullBitmap: make([]byte, 0, cap>>3),
	}
}
821036
func (table *Table) AddColumn(col *Column) {
	table.columnsSeq = append(table.columnsSeq, col.Name)
	table.columns = append(table.columns, col)
	colName := strings.ToLower(col.Name)
	if c, ok := table.columnsMap[colName]; ok {
		table.columnsMap[colName] = append(c, col)
	} else {
		table.columnsMap[colName] = []*Column{col}
	}

	if col.IsPrimaryKey {
		table.PrimaryKeys = append(table.PrimaryKeys, col.Name)
	}
	if col.IsAutoIncrement {
		table.AutoIncrement = col.Name
	}
	if col.IsCreated {
		table.Created[col.Name] = true
	}
	if col.IsUpdated {
		table.Updated = col.Name
	}
	if col.IsDeleted {
		table.Deleted = col.Name
	}
	if col.IsVersion {
		table.Version = col.Name
	}
}
195730
func (b *InsertBuilder) LitColumn(column, literal string) *InsertBuilder {
	b.columns = append(b.columns, initializer{
		column: column,
		value:  lit(literal),
	})
	return b
}
480216
func (d *Dataset) AppendDynamicColumn(header string, fn DynamicColumn) {
	d.headers = append(d.headers, header)
	d.constraints = append(d.constraints, nil)
	d.cols++
	for i, e := range d.data {
		d.data[i] = append(e, fn)
	}
}
582415
func (f *File) InsertCol(sheet, col string) error {
	num, err := ColumnNameToNumber(col)
	if err != nil {
		return err
	}
	return f.adjustHelper(sheet, columns, num, 1)
}
1306960
func (b *SqliteBuilder) RenameColumn(table, oldName, newName string) *Query {
	q := b.NewQuery("")
	q.LastError = errors.New("SQLite does not support renaming columns")
	return q
}
6904
func (list *List) Append(value Value) {
	list.values = append(list.values, value)
}
718750
func (d *Dataset) AppendConstrainedColumn(header string, constraint ColumnConstraint, cols []interface{}) error {
	err := d.AppendColumn(header, cols)
	if err != nil {
		return err
	}

	d.constraints[d.cols-1] = constraint
	return nil
}
422148
func (t *Table) getColumn(name string) (NonAliasColumn, error) {
	if c, ok := t.columnLookup[name]; ok {
		return c, nil
	}
	return nil, errors.Newf("No such column '%s' in table '%s'", name, t.name)
}
736796
func (tb *CreateTableBuilder) Column(name string) *ColumnBuilder {
	return &ColumnBuilder{
		tableBuilder: tb,
		name:         name,
	}
}
1049230
func DoubleColumn(name string, nullable NullableColumn) NonAliasColumn {
	if !validIdentifierName(name) {
		panic("Invalid column name in int column")
	}
	ic := &doubleColumn{}
	ic.name = name
	ic.nullable = nullable
	return ic
}
1361391
func (f fields) HasColumn(column string) bool {
	for _, field := range f {
		// TODO what about table name
		if field.column == column {
			return true
		}
	}
	return false
}
26732
func (ta *Table) AddColumn(name string, columnType querypb.Type, defval sqltypes.Value, extra string) {
	index := len(ta.Columns)
	ta.Columns = append(ta.Columns, TableColumn{Name: sqlparser.NewColIdent(name)})
	ta.Columns[index].Type = columnType
	if extra == "auto_increment" {
		ta.Columns[index].IsAuto = true
		// Ignore default value, if any
		return
	}
	if defval.IsNull() {
		return
	}
	// Schema values are trusted.
	ta.Columns[index].Default = sqltypes.MakeTrusted(ta.Columns[index].Type, defval.Raw())
}
945353
func NewListCommand(deps ListDeps) modelcmd.ModelCommand {
	return modelcmd.Wrap(&ListCommand{deps: deps})
}