예제 #1
0
파일: join.go 프로젝트: amarantha-k/query
func NewJoin(keyspace datastore.Keyspace, join *algebra.Join) *Join {
	return &Join{
		keyspace: keyspace,
		term:     join.Right(),
		outer:    join.Outer(),
	}
}
예제 #2
0
func (this *builder) VisitJoin(node *algebra.Join) (interface{}, error) {
	_, err := node.Left().Accept(this)
	if err != nil {
		return nil, err
	}

	right := node.Right()
	right.SetDefaultNamespace(this.namespace)
	namespace, err := this.datastore.NamespaceByName(right.Namespace())
	if err != nil {
		return nil, err
	}

	keyspace, err := namespace.KeyspaceByName(right.Keyspace())
	if err != nil {
		return nil, err
	}

	join := NewJoin(keyspace, node)
	this.subChildren = append(this.subChildren, join)
	return nil, nil
}