internal/protocol/session.go
func (s *Session) QueryDirect(query string) (uint64, *ResultFieldSet, *FieldValues, PartAttributes, error) {
	s.mu.Lock()
	defer s.mu.Unlock()

	if err := s.writeRequest(mtExecuteDirect, false, command(query)); err != nil {
		return 0, nil, nil, nil, err
	}

	var id uint64
	var resultFieldSet *ResultFieldSet
	fieldValues := newFieldValues()

	f := func(p replyPart) {

		switch p := p.(type) {

		case *resultsetID:
			p.id = &id
		case *resultMetadata:
			resultFieldSet = newResultFieldSet(p.numArg)
			p.resultFieldSet = resultFieldSet
		case *resultset:
			p.s = s
			p.resultFieldSet = resultFieldSet
			p.fieldValues = fieldValues
		}
	}

	if err := s.readReply(f); err != nil {
		return 0, nil, nil, nil, err
	}

	return id, resultFieldSet, fieldValues, s.ph.partAttributes, nil
}
func (s *Session) QueryDirect(query string) (uint64, *ResultFieldSet, *FieldValues, PartAttributes, error) {
	s.mu.Lock()
	defer s.mu.Unlock()

	if err := s.writeRequest(mtExecuteDirect, false, command(query)); err != nil {
		return 0, nil, nil, nil, err
	}

	var id uint64
	var resultFieldSet *ResultFieldSet
	fieldValues := newFieldValues()

	f := func(p replyPart) {

		switch p := p.(type) {

		case *resultsetID:
			p.id = &id
		case *resultMetadata:
			resultFieldSet = newResultFieldSet(p.numArg)
			p.resultFieldSet = resultFieldSet
		case *resultset:
			p.s = s
			p.resultFieldSet = resultFieldSet
			p.fieldValues = fieldValues
		}
	}

	if err := s.readReply(f); err != nil {
		return 0, nil, nil, nil, err
	}

	return id, resultFieldSet, fieldValues, s.ph.partAttributes, nil
}
func ( s * Session ) QueryDirect ( query string ) ( uint64 , * ResultFieldSet , * FieldValues , PartAttributes , error ) { s . mu . Lock ( ) defer s . mu . Unlock ( ) if err := s . writeRequest ( mtExecuteDirect , false , command ( query ) ) ; err != nil { return 0 , nil , nil , nil , err } var id uint64 var resultFieldSet * ResultFieldSet fieldValues := newFieldValues ( ) f := func ( p replyPart ) { switch p := p . ( type ) { case * resultsetID : p . id = & id case * resultMetadata : resultFieldSet = newResultFieldSet ( p . numArg ) p . resultFieldSet = resultFieldSet case * resultset : p . s = s p . resultFieldSet = resultFieldSet p . fieldValues = fieldValues } } if err := s . readReply ( f ) ; err != nil { return 0 , nil , nil , nil , err } return id , resultFieldSet , fieldValues , s . ph . partAttributes , nil }
// QueryDirect executes a query without query parameters.
QueryDirect executes a query without query parameters .