Skip to content

Commit

Permalink
Schema from uri now accesses array to allow attribute enumerations
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 20, 2023
1 parent 9c94e27 commit 4812e36
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions R/TileDBArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,24 @@ setMethod("schema", "tiledb_array", function(object, ...) {
schema_xptr <- libtiledb_array_schema_load(ctxptr, uri)
}
}
.array_open <- function(ctxptr, uri, enckey=character()) {
if (length(enckey) > 0) {
arr_xptr <- libtiledb_array_open(ctxptr, uri, "READ", enckey)
} else {
arr_xptr <- libtiledb_array_open(ctxptr, uri, "READ")
}
}

#' Return a schema from a URI character value
#'
#' @param object A character variable with a URI
#' @param ... Extra parameters such as \sQuote{enckey}, the encryption key
#' @return The scheme for the object
setMethod("schema", "character", function(object, ...) {
ctx <- tiledb_get_context()
schema_xptr <- .array_schema_load(ctx@ptr, object, ...)
return(tiledb_array_schema.from_ptr(schema_xptr))
ctx <- tiledb_get_context()
schema_xptr <- .array_schema_load(ctx@ptr, object, ...)
array_xptr <- .array_open(ctx@ptr, object, ...)
return(tiledb_array_schema.from_ptr(schema_xptr, array_xptr))
})


Expand Down

0 comments on commit 4812e36

Please sign in to comment.