code: func Scan(value interface{}, rows Rows) (int64, error) {
  	columns, err := rows.Columns()
  	if err != nil {
  		return 0, err
  	}
  
  	rv := reflect.ValueOf(value)
  	if rv.Kind() != reflect.Ptr || rv.IsNil() {
  		panic("grimoire: record parameter must be a pointer")
  	}
  
  	count := int64(0)
  	rv = rv.Elem()
  	var index map[string]int
  	isScanner := rv.Addr().Type().Implements(typeScanner)
  	isSlice := rv.Kind() == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8 && !isScanner
  
  	if !isScanner {
  		if isSlice {
  			rv.Set(reflect.MakeSlice(rv.Type(), 0, 0))
  			index = fieldIndex(rv.Type().Elem())
  		} else {
  			index = fieldIndex(rv.Type())
  		}
  	}
  
  	for rows.Next() {
  		var elem reflect.Value
  		if isSlice {
  			elem = reflect.New(rv.Type().Elem()).Elem()
  		} else {
  			elem = rv
  		}
  
  		var ptr []interface{}
  		var reset map[int]reflect.Value
  		if isScanner {
  			ptr = []interface{}{elem.Addr().Interface()}
  		} else {
  			ptr, reset = fieldPtr(elem, index, columns)
  		}
  
  		err = rows.Scan(ptr...)
  		if err != nil {
  			return 0, err
  		}
  
  		count++
  
  		for index, field := range reset {
  			if v := reflect.ValueOf(ptr[index]).Elem().Elem(); v.IsValid() {
  				field.Set(v)
  			}
  		}
  
  		if isSlice {
  			rv.Set(reflect.Append(rv, elem))
  		} else {
  			break
  		}
  	}
  
  	return count, nil
  }
docs: // Scan rows into interface