本文整理匯總了Golang中github.com/couchbase/query/expression.Formalizer.Allowed方法的典型用法代碼示例。如果您正苦於以下問題:Golang Formalizer.Allowed方法的具體用法?Golang Formalizer.Allowed怎麽用?Golang Formalizer.Allowed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/couchbase/query/expression.Formalizer
的用法示例。
在下文中一共展示了Formalizer.Allowed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Formalize
/*
Qualify all identifiers for the parent expression. Checks for
duplicate aliases.
*/
func (this *SubqueryTerm) Formalize(parent *expression.Formalizer) (f *expression.Formalizer, err error) {
err = this.subquery.Formalize()
if err != nil {
return
}
alias := this.Alias()
if alias == "" {
err = errors.NewNoTermNameError("FROM", "plan.subquery.requires_name_or_alias")
return
}
_, ok := parent.Allowed().Field(alias)
if ok {
err = errors.NewDuplicateAliasError("subquery", alias, "plan.subquery.duplicate_alias")
return nil, err
}
f = expression.NewFormalizer(alias, parent)
return
}
示例2: Formalize
/*
Qualify all identifiers for the parent expression. Checks for
duplicate aliases.
*/
func (this *KeyspaceTerm) Formalize(parent *expression.Formalizer) (f *expression.Formalizer, err error) {
keyspace := this.Alias()
if keyspace == "" {
err = errors.NewNoTermNameError("FROM", "plan.keyspace.requires_name_or_alias")
return
}
f = expression.NewFormalizer("", parent)
if this.keys != nil {
_, err = this.keys.Accept(f)
if err != nil {
return
}
}
_, ok := parent.Allowed().Field(keyspace)
if ok {
err = errors.NewDuplicateAliasError("subquery", keyspace, "plan.keyspace.duplicate_alias")
return nil, err
}
f.SetKeyspace(keyspace)
return
}