Skip to content

Commit

Permalink
Wrap tiledb_handle_load_array_schema_request
Browse files Browse the repository at this point in the history
This wraps the new tiledb_handle_load_array_schema_request function in
TileDB.
  • Loading branch information
davisp committed Oct 20, 2023
1 parent 1b1b761 commit 68869dc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions array_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "C"
import (
"fmt"
"os"
"runtime"
"unsafe"
)

Expand Down Expand Up @@ -425,3 +426,22 @@ func (a *ArraySchema) Type() (ArrayType, error) {

return ArrayType(arrayType), nil
}

// Handle a LoadArraySchemaRequest. This is used by TileDB-Cloud
func HandleLoadArraySchemaRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error) {
response, err := NewBuffer(array.context)
if err != nil {
return nil, fmt.Errorf("error deserializing load array schema request: %s", array.context.LastError())
}

ret := C.tiledb_handle_load_array_schema_request(array.context.tiledbContext, array.tiledbArray, C.tiledb_serialization_type_t(serializationType),

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Experimental_Test (1.20)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Experimental_Test (1.21)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Address_Sanitizer (1.20)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Test (1.20)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Address_Sanitizer (1.21)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Linux_Test (1.21)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Macos_Experimental_Test (1.20)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Macos_Test (1.20)

could not determine kind of name for C.tiledb_handle_load_array_schema_request

Check failure on line 437 in array_schema.go

View workflow job for this annotation

GitHub Actions / Macos_Test (1.21)

could not determine kind of name for C.tiledb_handle_load_array_schema_request
request.tiledbBuffer, response.tiledbBuffer)
if ret != C.TILEDB_OK {
return nil, fmt.Errorf("error handling load array schema request: %s", array.context.LastError())
}

runtime.KeepAlive(request)
runtime.KeepAlive(array)

return response, nil
}

0 comments on commit 68869dc

Please sign in to comment.