// and returns the query q AND r, possibly reusing q's and r's storage.
185643
func (q *Query) and(r *Query) *Query {
	return q.andOr(r, QAnd)
}
1157335
func (s *DeleteByQueryService) Query(query Query) *DeleteByQueryService {
	s.query = query
	return s
}
1092425
func (q *Query) Query(model, query interface{}, params ...interface{}) (Result, error) {
	params = append(params, q.model)
	return q.db.QueryContext(q.ctx, model, query, params...)
}
1262881
func (ctx *Context) Query(name string) string {
	if ctx.query == nil {
		ctx.query = ctx.Req.URL.Query()
	}
	return ctx.query.Get(name)
}
622067
func (t Term) And(args ...interface{}) Term {
	return constructMethodTerm(t, "And", p.Term_AND, args, map[string]interface{}{})
}
845779
func (s *Store) Query(qr *QueryRequest) (*QueryResponse, error) {
	return s.query(nil, qr)
}
89611
func (qb *Builder) And(queryBuilders ...*Builder) *Builder {
	return NewBuilder(qb.and(queryBuilderIterator(queryBuilders...)))
}
1146764
func (b *SearchRequestBuilder) Query() *QueryBuilder {
	if b.queryBuilder == nil {
		b.queryBuilder = NewQueryBuilder()
	}
	return b.queryBuilder
}
153756
func (qb *TiDBQueryBuilder) And(cond string) QueryBuilder {
	qb.Tokens = append(qb.Tokens, "AND", cond)
	return qb
}
117456
func (r *SearchRequest) Query(query Query) *SearchRequest {
	r.searchSource = r.searchSource.Query(query)
	return r
}
598142
func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {
	err := d.Flush()
	if err != nil {
		return nil, err
	}

	return d.child.Query(q)
}
980143
func (session *Session) Q(sqlStr string, params ...interface{}) (resultsSlice []*ResultSet, err error) {

	defer session.resetStatement()
	if session.IsAutoClose {
		defer session.Close()
	}

	resultsSlice = make([]*ResultSet, 0)
	rows, err := session.queryRows(sqlStr, params...)
	if rows != nil {
		if err == nil {
			resultsSlice, err = rows2ResultSetSlice(rows)
		}
		rows.Close()
	}
	return
}
824040
func (v *VerbalExpression) And(ve *VerbalExpression) *VerbalExpression {
	return v.add("(?:" + ve.Regex().String() + ")")
}
801397
func (c *PreparedQuery) Get(queryID string, q *QueryOptions) ([]*PreparedQueryDefinition, *QueryMeta, error) {
	var out []*PreparedQueryDefinition
	qm, err := c.c.query("/v1/query/"+queryID, &out, q)
	if err != nil {
		return nil, nil, err
	}
	return out, qm, nil
}
901483
func (s *Store) query(c *Connection, qr *QueryRequest) (*QueryResponse, error) {
	if c == nil {
		s.connsMu.RLock()
		c = s.conns[defaultConnID]
		s.connsMu.RUnlock()
	}
	c.SetLastUsedNow()

	s.restoreMu.RLock()
	defer s.restoreMu.RUnlock()
	start := time.Now()

	if qr.Lvl == Strong {
		d := &databaseSub{
			ConnID:  c.ID,
			Atomic:  qr.Atomic,
			Queries: qr.Queries,
			Timings: qr.Timings,
		}
		cmd, err := newCommand(query, d)
		if err != nil {
			return nil, err
		}
		b, err := json.Marshal(cmd)
		if err != nil {
			return nil, err
		}

		f := s.raft.Apply(b, s.ApplyTimeout)
		if e := f.(raft.Future); e.Error() != nil {
			if e.Error() == raft.ErrNotLeader {
				return nil, ErrNotLeader
			}
			return nil, e.Error()
		}

		switch r := f.Response().(type) {
		case *fsmQueryResponse:
			return &QueryResponse{
				Rows: r.rows,
				Time: time.Since(start).Seconds(),
				Raft: &RaftResponse{f.Index(), s.raftID},
			}, r.error
		case *fsmGenericResponse:
			return nil, r.error
		default:
			panic("unsupported type")
		}
	}

	if qr.Lvl == Weak && s.raft.State() != raft.Leader {
		return nil, ErrNotLeader
	}

	r, err := c.db.Query(qr.Queries, qr.Atomic, qr.Timings)
	return &QueryResponse{
		Rows: r,
		Time: time.Since(start).Seconds(),
	}, err
}
96927
func Q(query string, params ...interface{}) types.ValueAppender {
	return orm.Q(query, params...)
}
848399
func (rf Range) AND(f Range) Range {
	return Range(func(v Version) bool {
		return rf(v) && f(v)
	})
}