Sets the query for this record box for generating records.
        
        :param      query | <Query> || None
762665
def setQuery(self, query, autoRefresh=True):
        
        self._query = query
        
        tableType = self.tableType()
        if not tableType:
            return False
        
        if autoRefresh:
            self.refresh(tableType.select(where = query))
        
        return True
1301598
def query(self):
        
        queryWidget = self.queryWidget()
        
        # check to see if there is an active container for this widget
        container = queryWidget.containerFor(self)
        if container:
            return container.query()
        
        elif QueryCompound.typecheck(self._query):
            return self._query
        
        # generate a new query from the editor
        column = self.uiColumnDDL.currentSchemaPath()
        plugin = self.currentPlugin()
        editor = self.editor()
        op     = self.uiOperatorDDL.currentText()
        
        if column and plugin:
            query = Query(column)
            plugin.setupQuery(query, op, editor)
            return query
        else:
            return Query()
829599
def _run_query(self, query):
        
        query_request = self.service.jobs()
        logger.debug('Running query: %s', query)
        start = datetime.now()
        resp = query_request.query(
            projectId=self.project_id, body={'query': query}
        ).execute()
        duration = datetime.now() - start
        logger.debug('Query response (in %s): %s', duration, resp)
        if not resp['jobComplete']:
            logger.error('Error: query reported job not complete!')
        if int(resp['totalRows']) == 0:
            return []
        if int(resp['totalRows']) != len(resp['rows']):
            logger.error('Error: query reported %s total rows, but only '
                         'returned %d', resp['totalRows'], len(resp['rows']))
        data = []
        fields = [f['name'] for f in resp['schema']['fields']]
        for row in resp['rows']:
            d = {}
            for idx, val in enumerate(row['f']):
                d[fields[idx]] = val['v']
            data.append(d)
        return data
696533
@NonNull
    public Searcher setQuery(@NonNull Query query) {
        this.query = query;
        this.query.setPage(0);
        return this;
    }
469410
def setQuery(self, query):
        
        if not query.isNull() and hash(query) == hash(self._query):
            return
        
        self._query = query
        
        if QueryCompound.typecheck(query):
            self.uiColumnDDL.hide()
            self.uiOperatorDDL.hide()
            
            # setup the compound editor
            editor = XLineEdit(self)
            editor.setReadOnly(True)
            editor.setText(query.name() + ' %s' % nativestring(query))
            editor.setHint(nativestring(query))
            
            self.setEditor(editor)
        
        else:
            self.uiColumnDDL.show()
            self.uiOperatorDDL.show()
            
            text = query.columnName()
            self.uiColumnDDL.setCurrentSchemaPath(nativestring(text))
            
            self.uiOperatorDDL.blockSignals(True)
            plug = self.currentPlugin()
            if plug:
                op = plug.operator(query.operatorType(), query.value())
                
                index = self.uiOperatorDDL.findText(op)
                if index != -1:
                    self.uiOperatorDDL.setCurrentIndex(index)
            
            self.uiOperatorDDL.blockSignals(False)
        
        self.refreshButtons()
1289495
def db_query(self, query, args=None):
        
        if args is None:
            self.cursor.execute(query)
        else:
            self.cursor.execute(query, args)
731760
def __store_query(self, query_items):
        
        temp_index = self._current_query_index
        if len(self._queries) - 1 < temp_index:
            self._queries.append([])

        self._queries[temp_index].append(query_items)
1006181
public void updateQuery(QueryControllerQuery query) {
		int position = getElementPosition(query.getID());
		queries.set(position, query);
	}
990766
def query(self, query):
    '''
    '''
    self.logger.info('%s: query %s' % (self, query))
    return super(LoggingDatastore, self).query(query)
266107
def query=(new_query)
      if new_query && !new_query.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_query.class} into String."
      end
      @query = new_query ? new_query.to_str : nil

      # Reset dependent values
      remove_instance_variable(:@normalized_query) if defined?(@normalized_query)
      remove_composite_values
    end
607494
def delete(self, query):
        

        record = self.get(query=query).one()

        self._url = self._url_builder.get_appended_custom("/{0}".format(record['sys_id']))
        return self._get_response('DELETE').one()
195249
def prepare_query(query):
    

    for name in query:
        value = query[name]

        # None is sent as an empty string.
        if value is None:
            query[name] = ""

        # Booleans are sent as 0 or 1.
        elif isinstance(value, bool):
            query[name] = int(value)

        # XXX shouldn't this just check for basestring instead?
        elif isinstance(value, dict):
            raise ValueError("Invalid query data type %r" %
                             type(value).__name__)
62894
def setQuery(self, query):
        
        if query is None:
            return
        
        count = {}
        
        for widget in self.findChildren(QWidget):
            column = nativestring(widget.objectName())
            count.setdefault(column, 0)
            count[column] += 1
            
            success, value, _ = query.findValue(column, count[column])
            if success:
                projexui.setWidgetValue(widget, value)
927851
def setQuery(self, query):
        
        self.queryType = self._parseQueryType(query)
        self.queryString = self.injectPrefixes(query)
        self.addParameter('email', self.email)
        self.addParameter('password', self.password)
1050810
def execute(self, query, args=None):
        
        self._ensure_conn()
        cur = self._conn.cursor()
        yield cur.execute(query, args)
        raise Return(cur)
895491
def _setop(self, query):
        
        if isinstance(query.select, list):
            # RETURN BORING RESULT SET
            selects = FlatList()
            for s in listwrap(query.select):
                if isinstance(s.value, Mapping):
                    for k, v in s.value.items:
                        selects.append(sql_alias(v, quote_column(s.name + "." + k)))
                if isinstance(s.value, list):
                    for i, ss in enumerate(s.value):
                        selects.append(sql_alias(s.value, quote_column(s.name + "," + str(i))))
                else:
                    selects.append(sql_alias(s.value, quote_column(s.name)))

            sql = expand_template("""
                SELECT
                    {{selects}}
                FROM
                    {{table}}
                {{where}}
                {{sort}}
                {{limit}}
            """, {
                "selects": SQL(",\n".join(selects)),
                "table": self._subquery(query["from"])[0],
                "where": self._where2sql(query.where),
                "limit": self._limit2sql(query.limit),
                "sort": self._sort2sql(query.sort)
            })

            def post_process(sql):
                result = self.db.query(sql)
                for s in listwrap(query.select):
                    if isinstance(s.value, Mapping):
                        for r in result:
                            r[s.name] = {}
                            for k, v in s.value:
                                r[s.name][k] = r[s.name + "." + k]
                                r[s.name + "." + k] = None

                    if isinstance(s.value, list):
                        # REWRITE AS TUPLE
                        for r in result:
                            r[s.name] = tuple(r[s.name + "," + str(i)] for i, ss in enumerate(s.value))
                            for i, ss in enumerate(s.value):
                                r[s.name + "," + str(i)] = None

                expand_json(result)
                return result

            return sql, post_process  # RETURN BORING RESULT SET
        else:
            # RETURN LIST OF VALUES
            if query.select.value == ".":
                select = "*"
            else:
                name = query.select.name
                select = sql_alias(query.select.value, quote_column(name))

            sql = expand_template("""
                SELECT
                    {{selects}}
                FROM
                    {{table}}
                {{where}}
                {{sort}}
                {{limit}}
            """, {
                "selects": SQL(select),
                "table": self._subquery(query["from"])[0],
                "where": self._where2sql(query.where),
                "limit": self._limit2sql(query.limit),
                "sort": self._sort2sql(query.sort)
            })

            if query.select.value == ".":
                def post(sql):
                    result = self.db.query(sql)
                    expand_json(result)
                    return result

                return sql, post
            else:
                return sql, lambda sql: [r[name] for r in self.db.query(sql)]
271226
public function setQuery($query)
    {
        if (!empty($query)) {
            $this->data['query'] = $this->_queryToArray($query);
        }

        return $this;
    }