func (pq *PropertyQuery) FindBools(valueIfNil *bool) ([]bool, error) {
	return cGetBools(func() *C.OBX_int8_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int8s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int8_t(0)
			if *valueIfNil {
				cValueIfNil = 1
			}
			return C.obx_query_prop_find_int8s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
FindBools returns an int8 slice composed of values of the given property across all objects matching the query.
Parameter valueIfNil - value that should be returned instead of NULL values on object fields.
If `valueIfNil = nil` is given, objects with NULL values of the specified field are skipped.
package objectbox
import "C"
import (
	"fmt"
	"runtime"
	"sync"
	"unsafe"
)
type PropertyQuery struct {
	cPropQuery *C.OBX_query_prop
	closeMutex sync.Mutex
	query      *Query
}
func newPropertyQuery(query *Query, propertyId TypeId) (*PropertyQuery, error) {
	var pq = &PropertyQuery{query: query}
	if err := cCallBool(func() bool {
		pq.cPropQuery = C.obx_query_prop(query.cQuery, C.obx_schema_id(propertyId))
		return pq.cPropQuery != nil
	}); err != nil {
		return nil, err
	}
	runtime.SetFinalizer(pq, propQueryFinalizer)
	return pq, nil
}
func (pq *PropertyQuery) Close() error {
	pq.closeMutex.Lock()
	defer pq.closeMutex.Unlock()
	if pq.cPropQuery != nil {
		return cCall(func() C.obx_err {
			var err = C.obx_query_prop_close(pq.cPropQuery)
			pq.cPropQuery = nil
			runtime.SetFinalizer(pq, nil)  
			return err
		})
	}
	return nil
}
func propQueryFinalizer(pq *PropertyQuery) {
	err := pq.Close()
	if err != nil {
		fmt.Printf("Error in PropertyQuery finalizer: %s", err)
	}
}
func (pq *PropertyQuery) Distinct(value bool) error {
	return cCall(func() C.obx_err {
		return C.obx_query_prop_distinct(pq.cPropQuery, C.bool(value))
	})
}
func (pq *PropertyQuery) DistinctString(value, caseSensitive bool) error {
	return cCall(func() C.obx_err {
		return C.obx_query_prop_distinct_case(pq.cPropQuery, C.bool(value), C.bool(caseSensitive))
	})
}
func (pq *PropertyQuery) Count() (uint64, error) {
	var cResult C.uint64_t
	if err := cCall(func() C.obx_err { return C.obx_query_prop_count(pq.cPropQuery, &cResult) }); err != nil {
		return 0, err
	}
	return uint64(cResult), nil
}
func (pq *PropertyQuery) Average() (float64, error) {
	var cResult C.double
	var cCount C.int64_t
	if err := cCall(func() C.obx_err { return C.obx_query_prop_avg(pq.cPropQuery, &cResult, &cCount) }); err != nil {
		return 0, err
	}
	return float64(cResult), nil
}
func (pq *PropertyQuery) MinFloat64() (float64, error) {
	var cResult C.double
	if err := cCall(func() C.obx_err { return C.obx_query_prop_min(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return float64(cResult), nil
}
func (pq *PropertyQuery) MaxFloat64() (float64, error) {
	var cResult C.double
	if err := cCall(func() C.obx_err { return C.obx_query_prop_max(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return float64(cResult), nil
}
func (pq *PropertyQuery) SumFloat64() (float64, error) {
	var cResult C.double
	if err := cCall(func() C.obx_err { return C.obx_query_prop_sum(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return float64(cResult), nil
}
func (pq *PropertyQuery) Min() (int64, error) {
	var cResult C.int64_t
	if err := cCall(func() C.obx_err { return C.obx_query_prop_min_int(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return int64(cResult), nil
}
func (pq *PropertyQuery) Max() (int64, error) {
	var cResult C.int64_t
	if err := cCall(func() C.obx_err { return C.obx_query_prop_max_int(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return int64(cResult), nil
}
func (pq *PropertyQuery) Sum() (int64, error) {
	var cResult C.int64_t
	if err := cCall(func() C.obx_err { return C.obx_query_prop_sum_int(pq.cPropQuery, &cResult, nil) }); err != nil {
		return 0, err
	}
	return int64(cResult), nil
}
func (pq *PropertyQuery) FindInts(valueIfNil *int) ([]int, error) {
	return cGetInts(func() *C.OBX_int64_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int64s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int64_t(*valueIfNil)
			return C.obx_query_prop_find_int64s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindUints(valueIfNil *uint) ([]uint, error) {
	return cGetUints(func() *C.OBX_int64_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int64s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int64_t(*valueIfNil)
			return C.obx_query_prop_find_int64s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindInt64s(valueIfNil *int64) ([]int64, error) {
	return cGetInt64s(func() *C.OBX_int64_array {
		return C.obx_query_prop_find_int64s(pq.cPropQuery, (*C.int64_t)(valueIfNil))
	})
}
func (pq *PropertyQuery) FindUint64s(valueIfNil *uint64) ([]uint64, error) {
	return cGetUint64s(func() *C.OBX_int64_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int64s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int64_t(*valueIfNil)
			return C.obx_query_prop_find_int64s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindInt32s(valueIfNil *int32) ([]int32, error) {
	return cGetInt32s(func() *C.OBX_int32_array {
		return C.obx_query_prop_find_int32s(pq.cPropQuery, (*C.int32_t)(valueIfNil))
	})
}
func (pq *PropertyQuery) FindUint32s(valueIfNil *uint32) ([]uint32, error) {
	return cGetUint32s(func() *C.OBX_int32_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int32s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int32_t(*valueIfNil)
			return C.obx_query_prop_find_int32s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindInt16s(valueIfNil *int16) ([]int16, error) {
	return cGetInt16s(func() *C.OBX_int16_array {
		return C.obx_query_prop_find_int16s(pq.cPropQuery, (*C.int16_t)(valueIfNil))
	})
}
func (pq *PropertyQuery) FindUint16s(valueIfNil *uint16) ([]uint16, error) {
	return cGetUint16s(func() *C.OBX_int16_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int16s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int16_t(*valueIfNil)
			return C.obx_query_prop_find_int16s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindInt8s(valueIfNil *int8) ([]int8, error) {
	return cGetInt8s(func() *C.OBX_int8_array {
		return C.obx_query_prop_find_int8s(pq.cPropQuery, (*C.int8_t)(valueIfNil))
	})
}
func (pq *PropertyQuery) FindUint8s(valueIfNil *uint8) ([]uint8, error) {
	return cGetUint8s(func() *C.OBX_int8_array {
		if valueIfNil == nil {
			return C.obx_query_prop_find_int8s(pq.cPropQuery, nil)
		} else {
			var cValueIfNil = C.int8_t(*valueIfNil)
			return C.obx_query_prop_find_int8s(pq.cPropQuery, &cValueIfNil)
		}
	})
}
func (pq *PropertyQuery) FindFloat64s(valueIfNil *float64) ([]float64, error) {
	return cGetFloat64s(func() *C.OBX_double_array {
		return C.obx_query_prop_find_doubles(pq.cPropQuery, (*C.double)(valueIfNil))
	})
}
func (pq *PropertyQuery) FindFloat32s(valueIfNil *float32) ([]float32, error) {
	return cGetFloat32s(func() *C.OBX_float_array {
		return C.obx_query_prop_find_floats(pq.cPropQuery, (*C.float)(valueIfNil))
	})
}