• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang expression.Mapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/couchbaselabs/query/expression.Mapper的典型用法代码示例。如果您正苦于以下问题:Golang Mapper类的具体用法?Golang Mapper怎么用?Golang Mapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Mapper类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: MapExpressions

/*
Apply mapper to where condition expressions.
*/
func (this *MergeDelete) MapExpressions(mapper expression.Mapper) (err error) {
	if this.where != nil {
		this.where, err = mapper.Map(this.where)
	}

	return
}
开发者ID:amarantha-k,项目名称:query,代码行数:10,代码来源:merge.go


示例2: 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:amarantha-k,项目名称:query,代码行数:36,代码来源:select.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:amarantha-k,项目名称:query,代码行数:38,代码来源:upsert.go


示例4: 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:amarantha-k,项目名称:query,代码行数:10,代码来源:result.go


示例5: 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:amarantha-k,项目名称:query,代码行数:12,代码来源:pair.go


示例6: 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:amarantha-k,项目名称:query,代码行数:13,代码来源:from.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:amarantha-k,项目名称:query,代码行数:13,代码来源:order.go


示例8: 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:amarantha-k,项目名称:query,代码行数:18,代码来源:update.go


示例9: 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:amarantha-k,项目名称:query,代码行数:19,代码来源:aggregate.go


示例10: 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:amarantha-k,项目名称:query,代码行数:25,代码来源:group.go


示例11: 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:amarantha-k,项目名称:query,代码行数:31,代码来源:delete.go


示例12: 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.exprs.MapExpressions(mapper)
	if err != nil {
		return
	}

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

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

	return
}
开发者ID:amarantha-k,项目名称:query,代码行数:26,代码来源:index_create.go



注:本文中的github.com/couchbaselabs/query/expression.Mapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang expression.Visitor类代码示例发布时间:2022-05-23
下一篇:
Golang expression.Expression类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap