Add an exists clause to the query.

        :param query: The exists query
        :type query: Builder or QueryBuilder

        :type boolean: str

        :type negate: bool

        :rtype: Builder
167594
def where_exists(self, query, boolean="and", negate=False):
        
        if isinstance(query, Builder):
            query = query.get_query()

        self.get_query().where_exists(query, boolean, negate)

        return self
1107300
def valid_query?(query)
      raise ArgumentError, "Query cannot be nil or empty" if query.to_s.empty?

      # Attempt to create a search query parser
      search = FoodCritic::Chef::Search.new
      search.create_parser(search.chef_search_grammars)

      if search.parser?
        search.parser.parse(query.to_s)
      else
        # If we didn't manage to get a parser then we can't know if the query
        # is valid or not.
        true
      end
    end
550560
def setQuery(self, query, autoRefresh=True):
        
        self.uiRecordTREE.setQuery(query, autoRefresh=autoRefresh)
391627
def Query(self, query, parameters=None):
    
    # TODO: catch Warning and return None.
    # Note that we cannot pass parameters as a keyword argument here.
    # A parameters value of None is not supported.
    if parameters:
      self._cursor.execute(query, parameters)
    else:
      self._cursor.execute(query)

    return self._cursor.fetchall()
676200
def setupQuery(self, query, op, editor):
        
        try:
            registry = self._operatorMap[nativestring(op)]
        except KeyError:
            return False
        
        op = registry.op
        value = registry.defaultValue
        
        if op is None:
            return False
        
        if editor is not None:
            value = self.editorValue(editor)
        
        query.setOperatorType(op)
        query.setValue(value)
        return True
688718
public void append(final Filter query) {
        switch (this.queryType) {
            case OR: {
                this.orFilter.or(query);
            }
            break;

            default:
            case AND: {
                this.andFilter.and(query);
            }
            break;
        }
    }
737776
def setCurrentQuery( self, query ):
        
        self.clear()
        
        for entry in query:
            self.addLineWidget(entry)
        
        # make sure we have the minimum number of widgets
        for i in range(self.minimumCount() - len(query)):
            self.addLineWidget()
1109588
private void appendExistsCriteria(ExistsCriteria c, StringBuffer buf)
    {
        Query subQuery = (Query) c.getValue();

        buf.append(c.getClause());
        appendSubQuery(subQuery, buf);
    }
3289
public Where<T, ID> exists(QueryBuilder<?, ?> subQueryBuilder) {
		// we do this to turn off the automatic addition of the ID column in the select column list
		subQueryBuilder.enableInnerQuery();
		addClause(new Exists(new InternalQueryBuilderWrapper(subQueryBuilder)));
		return this;
	}
401041
def create_criteria(cls, query):
        
        criteria = []
        for name, value in query.items():
            if isinstance(value, list):
                for inner_value in value:
                    criteria += cls.create_criteria({name: inner_value})
            else:
                criteria.append({
                    'criteria': {
                        'field': name,
                        'value': value,
                    },
                })
        return criteria or None
434172
def where(self, *args):
        ''' 
        '''
        if not self._table:
            raise errors.NoTableSelectedError('No Table Selected')

        clause = []
        self._query += ' WHERE '

        clause = [ self._clause_formatter(x) for x in args if x ]

        self._query += ' AND '.join(clause)

        payload = self._payload_builder(self._query)
        response = self.execute_query(payload)

        return response
45049
def exists(self, index, doc_type, id, **query_params):
        
        path = make_path(index, doc_type, id)
        return self._send_request('HEAD', path, params=query_params)
691898
def query(self, *args, **kwargs):
        
        clone = self._clone()
        queries = []
        from pyes.query import Query

        if args:
            for f in args:
                if isinstance(f, Query):
                    queries.append(f)
                else:
                    raise TypeError('Only Query objects can be passed as argument')

        for field, value in kwargs.items():
            if value == [None]:
                value = ["$$$$"]
            queries.append(self._build_inner_query(field, value))

        clone._queries.extend(queries)
        return clone
1029416
def add_clause(self, clause, no_return=True):
        

        if self.minisat:
            res = pysolvers.minisatgh_add_cl(self.minisat, clause)

            if res == False:
                self.status = False

            if not no_return:
                return res
239034
def paginate_query(self, query):
        

        if self.paginator is None:
            return None

        return self.paginator.paginate_query(query, self.request)
181125
private PlanBuilder appendExistSubqueryApplyNode(PlanBuilder subPlan, ExistsPredicate existsPredicate, boolean correlationAllowed)
    {
        if (subPlan.canTranslate(existsPredicate)) {
            // given subquery is already appended
            return subPlan;
        }

        PlanBuilder subqueryPlan = createPlanBuilder(existsPredicate.getSubquery());

        PlanNode subqueryPlanRoot = subqueryPlan.getRoot();
        if (isAggregationWithEmptyGroupBy(subqueryPlanRoot)) {
            subPlan.getTranslations().put(existsPredicate, BooleanLiteral.TRUE_LITERAL);
            return subPlan;
        }

        // add an explicit projection that removes all columns
        PlanNode subqueryNode = new ProjectNode(idAllocator.getNextId(), subqueryPlan.getRoot(), Assignments.of());

        Symbol exists = symbolAllocator.newSymbol("exists", BOOLEAN);
        subPlan.getTranslations().put(existsPredicate, exists);
        ExistsPredicate rewrittenExistsPredicate = new ExistsPredicate(BooleanLiteral.TRUE_LITERAL);
        return appendApplyNode(
                subPlan,
                existsPredicate.getSubquery(),
                subqueryNode,
                Assignments.of(exists, rewrittenExistsPredicate),
                correlationAllowed);
    }
1326171
private static DBObject addFieldExistsCriterion(DBObject query, String field) {
        return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true));
    }