// TiebaClientRawQuerySignature 给 rawQuery 进行贴吧客户端签名, 返回值为签名后的 rawQuery
507346
func TiebaClientRawQuerySignature(rawQuery string) (signedRawQuery string) {
	m := md5.New()
	m.Write(bytes.Replace(*(*[]byte)(unsafe.Pointer(&rawQuery)), []byte("&"), nil, -1))
	m.Write([]byte("tiebaclient!!!"))

	signedRawQuery = rawQuery + "&sign=" + strings.ToUpper(hex.EncodeToString(m.Sum(nil)))
	return
}
654330
func (res *Resource) ToPrimaryQueryParamsFromMetaValue(metaValues *MetaValues, context *qor.Context) (string, []interface{}) {
	var (
		sqls          []string
		primaryValues []interface{}
		scope         = context.GetDB().NewScope(res.Value)
	)

	if metaValues != nil {
		for _, field := range res.PrimaryFields {
			if metaField := metaValues.Get(field.Name); metaField != nil {
				sqls = append(sqls, fmt.Sprintf("%v.%v = ?", scope.QuotedTableName(), scope.Quote(field.DBName)))
				primaryValues = append(primaryValues, utils.ToString(metaField.Value))
			}
		}
	}

	return strings.Join(sqls, " AND "), primaryValues
}
53866
func Query(query url.Values) RequestOption {
	return func(req *http.Request) error {
		req.URL.RawQuery = query.Encode()
		return nil
	}
}
1139719
func csrfTokenFromQuery(param string) csrfTokenExtractor {
	return func(c echo.Context) (string, error) {
		token := c.Query(param)
		if token == "" {
			return "", errors.New("empty csrf token in query param")
		}
		return token, nil
	}
}
1024663
func (cc *Client) Query(request Request, options ...RequestOption) (Response, error) {

	options = append(options, addDefaultTimeout(fab.Query))
	options = append(options, addDefaultTargetFilter(cc.context, filter.ChaincodeQuery))

	return callQuery(cc, request, options...)
}
1078519
func (this *Engine) RawQuery(sql string, params ...interface{}) (resultsSlice []*ResultSet, err error) {
	session := this.NewSession()
	defer session.Close()
	resultsSlice, err = session.Q(sql, params...)
	return
}
1215623
func GetReqQueryParam(req *http.Request, headerName string) string {
	return strings.TrimSpace(req.URL.Query().Get(headerName))
}
422578
func (t *Template) GetAWSAppSyncGraphQLApiWithName(name string) (*resources.AWSAppSyncGraphQLApi, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSAppSyncGraphQLApi:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSAppSyncGraphQLApi not found", name)
}
52380
func (q *SimpleQueryStringQuery) DefaultOperator(defaultOperator string) *SimpleQueryStringQuery {
	q.defaultOperator = defaultOperator
	return q
}
495214
func (m HostVsanInternalSystem) QueryVsanObjectUuidsByFilter(ctx context.Context, uuids []string, limit int32, version int32) ([]string, error) {
	req := types.QueryVsanObjectUuidsByFilter{
		This:    m.Reference(),
		Uuids:   uuids,
		Limit:   &limit,
		Version: version,
	}

	res, err := methods.QueryVsanObjectUuidsByFilter(ctx, m.Client(), &req)
	if err != nil {
		return nil, err
	}

	return res.Returnval, nil
}
1306868
func (tx *Tx) NamedQuery(query string, arg interface{}) (*Rows, error) {
	return NamedQuery(tx, query, arg)
}
673659
func (me *TxDatabase) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
	me.Trace("QUERY ROW", query, args...)
	return me.Tx.QueryRowContext(ctx, query, args...)
}
1359879
func (r Network_Monitor_Version1_Query_Host) GetQueryType() (resp datatypes.Network_Monitor_Version1_Query_Type, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Monitor_Version1_Query_Host", "getQueryType", nil, &r.Options, &resp)
	return
}
1030533
func (api *KrakenApi) queryPrivate(method string, values url.Values, typ interface{}) (interface{}, error) {
	urlPath := fmt.Sprintf("/%s/private/%s", APIVersion, method)
	reqURL := fmt.Sprintf("%s%s", APIURL, urlPath)
	secret, _ := base64.StdEncoding.DecodeString(api.secret)
	values.Set("nonce", fmt.Sprintf("%d", time.Now().UnixNano()))

	// Create signature
	signature := createSignature(urlPath, values, secret)

	// Add Key and signature to request headers
	headers := map[string]string{
		"API-Key":  api.key,
		"API-Sign": signature,
	}

	resp, err := api.doRequest(reqURL, values, headers, typ)

	return resp, err
}
539877
func (sink *influxdbSink) composeRawQuery(metricName string, labels map[string]string, metricKeys []core.HistoricalKey, start, end time.Time) string {
	seriesName, fieldName := sink.metricToSeriesAndField(metricName)

	queries := make([]string, len(metricKeys))
	for i, key := range metricKeys {
		pred := sink.keyToSelector(key)
		if labels != nil {
			pred += fmt.Sprintf(" AND %s", sink.labelsToPredicate(labels))
		}
		if !start.IsZero() {
			pred += fmt.Sprintf(" AND time > '%s'", start.Format(time.RFC3339))
		}
		if !end.IsZero() {
			pred += fmt.Sprintf(" AND time < '%s'", end.Format(time.RFC3339))
		}
		queries[i] = fmt.Sprintf("SELECT time, %q FROM %q WHERE %s", fieldName, seriesName, pred)
	}

	return strings.Join(queries, "; ")
}
308586
func RedactSQLQuery(sql string) (string, error) {
	bv := map[string]*querypb.BindVariable{}
	sqlStripped, comments := SplitMarginComments(sql)

	stmt, err := Parse(sqlStripped)
	if err != nil {
		return "", err
	}

	prefix := "redacted"
	Normalize(stmt, bv, prefix)

	return comments.Leading + String(stmt) + comments.Trailing, nil
}
9948
func Query(parameterName string) {
	if current, ok := dslengine.CurrentDefinition().(*design.SecuritySchemeDefinition); ok {
		if current.Kind == design.APIKeySecurityKind || current.Kind == design.JWTSecurityKind {
			if current.In != "" {
				dslengine.ReportError("'In' previously defined through Header or Query")
				return
			}
			current.In = "query"
			current.Name = parameterName
			return
		}
	}
	dslengine.IncompatibleDSL()
}