carrow icon indicating copy to clipboard operation
carrow copied to clipboard

Generate Append functions by template

Open yonidavidson opened this issue 5 years ago • 3 comments

This requires a bit more refactoring in the C side in order to get a generic structure for this type of functions.

For example:

func (b *TimestampArrayBuilder) Append(val time.Time) error {
	r := C.array_builder_append_timestamp(b.ptr, C.longlong(val.UnixNano()))
	if r.err != nil {
		return errFromResult(r)
	}
	return nil
}
Go type: time.Time
C.array_builder_append_timestamp

should pass a pointer (and the C function will cast it) val.UnixNano should be defined as a Mutator function for the template.

yonidavidson avatar Jul 14 '19 06:07 yonidavidson