// add ORDER expression.
// "column" means ASC, "-column" means DESC.
353150
func (o querySet) OrderBy(exprs ...string) QuerySeter {
	o.orders = exprs
	return &o
}
983791
func (col *ColumnDefinition) Format(buf *TrackedBuffer) {
	buf.Myprintf("%v %v", col.Name, &col.Type)
}
638885
func (session *Session) Asc(colNames ...string) *Session {
	session.Statement.Asc(colNames...)
	return session
}
543813
func (table *TableElem) Columns() []ColumnElem {
	columns := make([]ColumnElem, len(table.order))
	for index, name := range table.order {
		columns[index] = table.C[name]
	}
	return columns
}
1373007
func (r *ShellTableRow) Column(strs ...string) *ShellTableColumn {
	newCol := &ShellTableColumn{new(bytes.Buffer)}
	r.columns = append(r.columns, newCol)
	newCol.WriteString(strings.Join(strs, " "))
	return newCol
}
554828
func (me *DefaultAdapter) InsertColumnsSql(buf *SqlBuilder, cols ColumnList) error {
	buf.WriteRune(space_rune)
	buf.WriteRune(left_paren_rune)
	if err := me.Literal(buf, cols); err != nil {
		return err
	}
	buf.WriteRune(right_paren_rune)
	return nil
}
206790
func (t *Table) Column(name string) Slice {
	if c, ok := t.cols[name]; ok {
		// It's a regular column or a constant column with a
		// cached expansion.
		return c
	}

	if cv, ok := t.consts[name]; ok {
		// Expand the constant column and cache the result.
		expanded := slice.Repeat(cv, t.len)
		t.cols[name] = expanded
		return expanded
	}

	return nil
}
1305144
func (s *rowSegment) Columns() []uint64 {
	a := make([]uint64, 0, s.Count())
	itr := s.data.Iterator()
	for v, eof := itr.Next(); !eof; v, eof = itr.Next() {
		a = append(a, v)
	}
	return a
}
253914
func (s *FieldSort) Order(ascending bool) *FieldSort {
	s.ascending = ascending
	return s
}
1078103
func (statement *Statement) Desc(colNames ...string) *Statement {
	var buf bytes.Buffer
	fmt.Fprintf(&buf, statement.OrderStr)
	if len(statement.OrderStr) > 0 {
		fmt.Fprint(&buf, ", ")
	}
	newColNames := statement.col2NewColsWithQuote(colNames...)
	fmt.Fprintf(&buf, "%v DESC", strings.Join(newColNames, " DESC, "))
	statement.OrderStr = buf.String()
	return statement
}
509967
func ItemsFromCols(cols []*expression.Column, desc bool) []Item {
	items := make([]Item, 0, len(cols))
	for _, col := range cols {
		items = append(items, Item{Col: col, Desc: desc})
	}
	return items
}
1092906
func Column(dat string, separator string, col int) string {
	var pattern string
	for idx := 1; idx < col; idx++ {
		pattern += fmt.Sprintf("[a-zA-Z0-9]+%s", separator)
	}
	pattern += fmt.Sprintf("%s%s*", "([a-zA-Z0-9]+)", separator)
	regx := regexp.MustCompile(pattern)
	result := regx.FindStringSubmatch(dat)
	if len(result) == 0 {
		return ""
	}
	return result[1]
}
714908
func (idx *Index) AddColumn(name string, cardinality uint64) {
	idx.Columns = append(idx.Columns, sqlparser.NewColIdent(name))
	if cardinality == 0 {
		cardinality = uint64(len(idx.Cardinality) + 1)
	}
	idx.Cardinality = append(idx.Cardinality, cardinality)
}
1251380
func Column(w int, s string) string {
	pad := w - len(s)
	padding := make([]byte, pad)
	for i := 0; i < pad; i++ {
		padding[i] = 0x20
	}
	return fmt.Sprintf("%s%s", string(padding), s)
}
883276
func (c ColumnClause) Compile(d Dialect, params *Parameters) (string, error) {
	if c.table == nil {
		return fmt.Sprintf(`"%s"`, c.name), nil
	} else {
		return fmt.Sprintf(`"%s"."%s"`, c.table.name, c.name), nil
	}
}
94978
func (m *machine) Column() int {
	lineOffset := m.p - m.sol
	return lineOffset + 1
}
687437
func (b *BaseBuilder) AddColumn(table, col, typ string) *Query {
	sql := fmt.Sprintf("ALTER TABLE %v ADD %v %v", b.db.QuoteTableName(table), b.db.QuoteColumnName(col), typ)
	return b.NewQuery(sql)
}