Documentation ¶
Index ¶
- func GetAggFields(fields []*field.Field) map[int]struct{}
- func HasAggFields(fields []*field.Field) bool
- type DistinctRset
- type FieldRset
- type GroupByRset
- type HavingRset
- type JoinRset
- type JoinType
- type LimitRset
- type OffsetRset
- type OrderByItem
- type OrderByRset
- type Recordset
- func (r Recordset) Do(f func(data []interface{}) (bool, error)) error
- func (r Recordset) Fields() (fields []*field.ResultField, err error)
- func (r Recordset) FirstRow() (row []interface{}, err error)
- func (r Recordset) GetFields() []interface{}
- func (r Recordset) Rows(limit, offset int) ([][]interface{}, error)
- type SelectFieldsRset
- type SelectFinalRset
- type SelectLockRset
- type ShowRset
- type TableRset
- type TableSource
- type UnionRset
- type WhereRset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAggFields ¶
GetAggFields gets aggregate fields position map.
func HasAggFields ¶
HasAggFields checks whether has aggregate field.
Types ¶
type DistinctRset ¶
type DistinctRset struct { Src plan.Plan SelectList *plans.SelectList }
DistinctRset is record set for distinct fields.
type GroupByRset ¶
type GroupByRset struct { By []expression.Expression Src plan.Plan SelectList *plans.SelectList }
GroupByRset is record set for group by fields.
func (*GroupByRset) HasAmbiguousField ¶
func (r *GroupByRset) HasAmbiguousField(indices []int, fields []*field.Field) bool
HasAmbiguousField checks whether have ambiguous group by fields.
func (*GroupByRset) String ¶
func (r *GroupByRset) String() string
type HavingRset ¶
type HavingRset struct { Src plan.Plan Expr expression.Expression }
HavingRset is record set for having fields.
func (*HavingRset) CheckAndUpdateSelectList ¶
func (r *HavingRset) CheckAndUpdateSelectList(selectList *plans.SelectList, groupBy []expression.Expression, tableFields []*field.ResultField) error
CheckAndUpdateSelectList checks having fields validity and set hidden fields to selectList.
func (*HavingRset) String ¶
func (r *HavingRset) String() string
String implements fmt.Stringer interface.
type JoinRset ¶
type JoinRset struct { Left interface{} Right interface{} Type JoinType On expression.Expression // contains filtered or unexported fields }
JoinRset is record set for table join.
type LimitRset ¶
LimitRset is record set for limit.
type OffsetRset ¶
OffsetRset is record set for limit offset.
func (*OffsetRset) String ¶
func (r *OffsetRset) String() string
type OrderByItem ¶
type OrderByItem struct { Expr expression.Expression Asc bool }
OrderByItem is order by item.
func (OrderByItem) String ¶
func (i OrderByItem) String() string
type OrderByRset ¶
type OrderByRset struct { By []OrderByItem Src plan.Plan SelectList *plans.SelectList }
OrderByRset is record set for order by fields.
func (*OrderByRset) CheckAndUpdateSelectList ¶
func (r *OrderByRset) CheckAndUpdateSelectList(selectList *plans.SelectList, tableFields []*field.ResultField) error
CheckAndUpdateSelectList checks order by fields validity and set hidden fields to selectList.
func (*OrderByRset) Plan ¶
Plan get SrcPlan/OrderByDefaultPlan. If src is NullPlan or order by fields are empty, then gets SrcPlan. Default gets OrderByDefaultPlan.
func (*OrderByRset) String ¶
func (r *OrderByRset) String() string
type Recordset ¶
Recordset implements rset.Recordset interface.
func (Recordset) Fields ¶
func (r Recordset) Fields() (fields []*field.ResultField, err error)
Fields implements rset.Recordset.
type SelectFieldsRset ¶
type SelectFieldsRset struct { Src plan.Plan SelectList *plans.SelectList }
SelectFieldsRset is record set to select fields.
type SelectFinalRset ¶
type SelectFinalRset struct { Src plan.Plan SelectList *plans.SelectList }
SelectFinalRset is record set to select final fields after where/group by/order by/... proccessing, like `select c1, c2 from t where c1 > 1`, SelectFinalRset gets c1 and c2 column data value after where condition filter.
type SelectLockRset ¶
SelectLockRset is record set for select for update.
type ShowRset ¶
type ShowRset struct { Target int DBName string TableName string ColumnName string Flag int Full bool }
ShowRset is record set to show.
type TableSource ¶
type TableSource struct { // Source is table.Ident or stmt.Statement. Source interface{} // Table source name. Name string }
TableSource is table source or sub select.
func (*TableSource) String ¶
func (t *TableSource) String() string