Run a query from a parse tree
509849
def _run(self, tree):
        
        if tree.throttle:
            limiter = self._parse_throttle(tree.table, tree.throttle)
            self._query_rate_limit = limiter
            del tree["throttle"]
            return self._run(tree)
        if tree.action == "SELECT":
            return self._select(tree, self.allow_select_scan)
        elif tree.action == "SCAN":
            return self._scan(tree)
        elif tree.action == "DELETE":
            return self._delete(tree)
        elif tree.action == "UPDATE":
            return self._update(tree)
        elif tree.action == "CREATE":
            return self._create(tree)
        elif tree.action == "INSERT":
            return self._insert(tree)
        elif tree.action == "DROP":
            return self._drop(tree)
        elif tree.action == "ALTER":
            return self._alter(tree)
        elif tree.action == "DUMP":
            return self._dump(tree)
        elif tree.action == "LOAD":
            return self._load(tree)
        elif tree.action == "EXPLAIN":
            return self._explain(tree)
        elif tree.action == "ANALYZE":
            self._analyzing = True
            self.connection.default_return_capacity = True
            return self._run(tree[1])
        else:
            raise SyntaxError("Unrecognized action '%s'" % tree.action)
221943
function querystring(query) {
  var parser = /([^=?&]+)=?([^&]*)/g
    , result = {}
    , part;

  while (part = parser.exec(query)) {
    var key = decode(part[1])
      , value = decode(part[2]);

    //
    // Prevent overriding of existing properties. This ensures that build-in
    // methods like `toString` or __proto__ are not overriden by malicious
    // querystrings.
    //
    if (key in result) continue;
    result[key] = value;
  }

  return result;
}
443235
def parse_view(query):
    

    try:
        idx = query.lower().index('where')
        query = query[:idx]
    except ValueError:
        pass

    if not query.endswith(';'):
        query = query.strip()
        query += ';'

    result = _view_stmt.parseString(query)

    return View(result)
1308301
function run(query, params) {
        let stmt = sql.prepare(query);
        params = normalizeParams(params);
        stmt.run(params);
        stmt.free();
    }
1238044
final public void selectQuery() throws ParseException {
    select();
    from();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case WHERE:
      where();
      break;
    default:
      jj_la1[0] = jj_gen;
      ;
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ORDER_BY:
      sort();
      break;
    default:
      jj_la1[1] = jj_gen;
      ;
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LIMIT:
      limit();
      break;
    default:
      jj_la1[2] = jj_gen;
      ;
    }
    jj_consume_token(0);
  }
203774
def parse_querystring(self, req, name, field):
        """"""
        return core.get_value(req.GET, name, field)
239038
def parse_query(self, query):
        
        logger.debug(u'query to parse2: {}'.format(query))

        # this should find all records
        if query == {} or query is None:
            return Query()._id != u'-1'  # noqa

        q = None
        # find the final result of the generator
        for c in self.parse_condition(query):
            if q is None:
                q = c
            else:
                q = q & c

        logger.debug(u'new query item2: {}'.format(q))

        return q
905974
function query(queryString, args, callback) {
  getClient(function (err, client) {
    if (err) { callback(err); }

    if (!client) {
      callback('Could not connect to the database');
    }
    else {
      runQuery(client, queryString, args, callback);
    }
  });
}
567198
def build_query_fragment(query):
    
    root = etree.Element('query', nsmap={None: 'http://basex.org/rest'})
    text = etree.SubElement(root, 'text')
    text.text = etree.CDATA(query.strip())
    return root
516671
function queryParser( req, res, next ) {
	if ( !req.query ) {
		var val = parseUrl( req ).query;
		req.query = queryparse( val );
	}
	next();
}
1207106
function (query) {
        return _.isString(query) ? query.split(AMPERSAND).map(QueryParam.parseSingle) : [];
    }
994991
function parseQueryString(query) {
  var parts = query.split('&');
  var params = {};
  for (var i = 0, ii = parts.length; i < ii; ++i) {
    var param = parts[i].split('=');
    var key = param[0].toLowerCase();
    var value = param.length > 1 ? param[1] : null;
    params[decodeURIComponent(key)] = decodeURIComponent(value);
  }
  return params;
}
755577
private Map<String, Object> parseInsertIntoQuery(String query)
    {
        Map<String, Object> persistDetails = new HashMap<String, Object>();
        String insertReg = "(?i)^insert\\s+into\\s+(\\S+)\\s+(?:as\\s+(\\S+)\\s+)?FROM\\s+\\((.*)\\)$";
        Pattern r = Pattern.compile(insertReg);

        Matcher m = r.matcher(query);
        if (m.find())
        {
            try
            {
                parsePersistClause(m.group(1), persistDetails);
                persistDetails.put("format", m.group(2));
                persistDetails.put("fetchQuery", m.group(3));
            }
            catch (Exception e)
            {
                throw new KunderaException("Invalid Query");
            }
        }
        else
        {
            throw new KunderaException("Invalid Query");
        }

        return persistDetails;
    }
843781
def run(self):
        """"""
        paths = [x for x in practices.__dict__.values()
                 if hasattr(x, 'code')]

        for node in ast.walk(self.tree):
            try:
                lineno, col_offset = node.lineno, node.col_offset
            except AttributeError:
                # Not all nodes have coordinates, e.g.: ast.Module
                continue

            for checker in paths:
                if checker(node):
                    message = self.build_message(checker)
                    yield lineno, col_offset, message, type(self)
246035
def parse_querystring(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        return core.get_value(req.query, name, field)
266773
function begins(query, node) {
  var value = node[query.name]

  return (
    typeof value === 'string' &&
    value.slice(0, query.value.length) === query.value
  )
}
833724
def run_query(self, query):
        
        collection = self.ds.connection(self.collection_name)

        cursor = collection.find(query)
        if cursor.count() == 0:
            raise LookupError('Collection {0} has no {1} records'
                              .format(self.collection_name, self.model_klass.__name__))
        return [self.model_klass.from_json(entry) for entry in cursor]