當前位置: 首頁>>代碼示例>>Golang>>正文


Golang expression.Mapper類代碼示例

本文整理匯總了Golang中github.com/couchbase/query/expression.Mapper的典型用法代碼示例。如果您正苦於以下問題:Golang Mapper類的具體用法?Golang Mapper怎麽用?Golang Mapper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Mapper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: MapExpressions

/*
Applies mapper to all the expressions in the merge statement.
*/
func (this *Merge) MapExpressions(mapper expression.Mapper) (err error) {
	err = this.source.MapExpressions(mapper)
	if err != nil {
		return
	}

	this.key, err = mapper.Map(this.key)
	if err != nil {
		return
	}

	err = this.actions.MapExpressions(mapper)
	if err != nil {
		return
	}

	if this.limit != nil {
		this.limit, err = mapper.Map(this.limit)
		if err != nil {
			return
		}
	}

	if this.returning != nil {
		err = this.returning.MapExpressions(mapper)
	}

	return
}
開發者ID:jmptrader,項目名稱:query,代碼行數:32,代碼來源:merge.go

示例2: MapExpression

/*
Map the input expression of the result expr.
*/
func (this *ResultTerm) MapExpression(mapper expression.Mapper) (err error) {
	if this.expr != nil {
		this.expr, err = mapper.Map(this.expr)
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:10,代碼來源:result.go

示例3: MapExpressions

/*
Applies mapper to all the expressions in the upsert statement.
*/
func (this *Upsert) MapExpressions(mapper expression.Mapper) (err error) {
	if this.key != nil {
		this.key, err = mapper.Map(this.key)
		if err != nil {
			return
		}
	}

	if this.value != nil {
		this.value, err = mapper.Map(this.value)
		if err != nil {
			return
		}
	}

	if this.values != nil {
		err = this.values.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.query != nil {
		err = this.query.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.returning != nil {
		err = this.returning.MapExpressions(mapper)
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:38,代碼來源:upsert.go

示例4: MapExpressions

/*
This method maps all the constituent clauses, namely the from,
let, where, group by and projection(select) within a Subselect
statement.
*/
func (this *Subselect) MapExpressions(mapper expression.Mapper) (err error) {
	if this.from != nil {
		err = this.from.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.let != nil {
		err = this.let.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.where != nil {
		this.where, err = mapper.Map(this.where)
		if err != nil {
			return
		}
	}

	if this.group != nil {
		err = this.group.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	return this.projection.MapExpressions(mapper)
}
開發者ID:jmptrader,項目名稱:query,代碼行數:36,代碼來源:select_sub.go

示例5: MapExpressions

/*
Maps the source array of the unnest if the parent object(left)
is mapped successfully.
*/
func (this *Unnest) MapExpressions(mapper expression.Mapper) (err error) {
	err = this.left.MapExpressions(mapper)
	if err != nil {
		return
	}

	this.expr, err = mapper.Map(this.expr)
	return
}
開發者ID:mschoch,項目名稱:query,代碼行數:13,代碼來源:from.go

示例6: MapExpressions

/*
Applies mapper to the key and value expressions.
*/
func (this *Pair) MapExpressions(mapper expression.Mapper) (err error) {
	this.Key, err = mapper.Map(this.Key)
	if err != nil {
		return
	}

	this.Value, err = mapper.Map(this.Value)
	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:12,代碼來源:pair.go

示例7: MapExpressions

/*
Map Expressions for all sort terms in the receiver.
*/
func (this SortTerms) MapExpressions(mapper expression.Mapper) (err error) {
	for _, term := range this {
		term.expr, err = mapper.Map(term.expr)
		if err != nil {
			return
		}
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:13,代碼來源:order.go

示例8: MapChildren

/*
It is a utility function that takes in as input parameter
a mapper and maps the involved expressions to an expression.
If there is an error during the mapping, an error is returned.
*/
func (this *AggregateBase) MapChildren(mapper expression.Mapper) error {
	children := this.Children()

	for i, c := range children {
		expr, err := mapper.Map(c)
		if err != nil {
			return err
		}

		children[i] = expr
	}

	return nil
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:19,代碼來源:aggregate.go

示例9: MapExpressions

/*
Applies mapper to the path expressions and update-for in
the unset Term.
*/
func (this *UnsetTerm) MapExpressions(mapper expression.Mapper) (err error) {
	path, err := mapper.Map(this.path)
	if err != nil {
		return err
	}

	this.path = path.(expression.Path)

	if this.updateFor != nil {
		err = this.updateFor.MapExpressions(mapper)
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:18,代碼來源:update_unset.go

示例10: MapExpressions

/*
Apply mapper to expressions in the WHEN clause and bindings.
*/
func (this *UpdateFor) MapExpressions(mapper expression.Mapper) (err error) {
	err = this.bindings.MapExpressions(mapper)
	if err != nil {
		return
	}

	if this.when != nil {
		this.when, err = mapper.Map(this.when)
		if err != nil {
			return
		}
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:18,代碼來源:update_for.go

示例11: MapExpressions

/*
This method maps all the constituent terms, namely projection and keys
in the FROM clause.
*/
func (this *KeyspaceTerm) MapExpressions(mapper expression.Mapper) (err error) {
	if this.projection != nil {
		expr, err := mapper.Map(this.projection)
		if err != nil {
			return err
		}

		this.projection = expr.(expression.Path)
	}

	if this.keys != nil {
		this.keys, err = mapper.Map(this.keys)
		if err != nil {
			return err
		}
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:23,代碼來源:from_keyspace.go

示例12: MapExpressions

/*
This method maps all the constituent clauses, namely the
by, letting and having within a group by clause.
*/
func (this *Group) MapExpressions(mapper expression.Mapper) (err error) {
	if this.by != nil {
		err = this.by.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.letting != nil {
		err = this.letting.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.having != nil {
		this.having, err = mapper.Map(this.having)
	}

	return
}
開發者ID:mschoch,項目名稱:query,代碼行數:25,代碼來源:group.go

示例13: MapExpressions

/*
Applies mapper to all the expressions in the delete statement.
*/
func (this *Delete) MapExpressions(mapper expression.Mapper) (err error) {
	if this.keys != nil {
		this.keys, err = mapper.Map(this.keys)
		if err != nil {
			return err
		}
	}

	if this.where != nil {
		this.where, err = mapper.Map(this.where)
		if err != nil {
			return err
		}
	}

	if this.limit != nil {
		this.limit, err = mapper.Map(this.limit)
		if err != nil {
			return err
		}
	}

	if this.returning != nil {
		err = this.returning.MapExpressions(mapper)
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:31,代碼來源:delete.go

示例14: MapExpressions

/*
This method maps all the constituent clauses, namely the expression,
partition and where clause within a create index statement.
*/
func (this *CreateIndex) MapExpressions(mapper expression.Mapper) (err error) {
	err = this.keys.MapExpressions(mapper)
	if err != nil {
		return
	}

	if this.partition != nil {
		err = this.partition.MapExpressions(mapper)
		if err != nil {
			return
		}
	}

	if this.where != nil {
		this.where, err = mapper.Map(this.where)
		if err != nil {
			return
		}
	}

	return
}
開發者ID:pkdevboxy,項目名稱:query,代碼行數:26,代碼來源:index_create.go

示例15: MapExpressions

/*
This method maps all the constituent clauses, namely the subresult,
order, limit and offset within a Select statement.
*/
func (this *Select) MapExpressions(mapper expression.Mapper) (err error) {
	err = this.subresult.MapExpressions(mapper)
	if err != nil {
		return
	}

	if this.order != nil {
		err = this.order.MapExpressions(mapper)
	}

	if this.limit != nil {
		this.limit, err = mapper.Map(this.limit)
		if err != nil {
			return
		}
	}

	if this.offset != nil {
		this.offset, err = mapper.Map(this.offset)
	}

	return
}
開發者ID:jmptrader,項目名稱:query,代碼行數:27,代碼來源:select.go


注:本文中的github.com/couchbase/query/expression.Mapper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。