-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Low-level interop for PG arrays (#636)
* c-shims for PG array functions * suggested changes for shims * Introduce RawArray abstraction This offers safe accessors to the underlying ArrayType's fields, without imposing any more burden on the data in question. * Port ARR_HASNULL to RawArray * Introduce fat pointer fns into RawArray This also ports over ARR_DIMS(ArrayType*), and ARR_NELEMS, which wraps ArrayGetNItems(ndim, *dims) * Port ARR_DATA_PTR to RawArray::data * Clarify safety requirements for RawArray::{dims, data} * Port ARR_NULLBITMAP to RawArray::nulls * Document test safety remarks * sub pub from pgx::array extern fn * Explain Rust type init requirements * Expand on RawArray description Includes a general usage note on lengths. * Note reborrow in test * Introduce even-lower-level ArrayPtr * Rough draft of ArrayPtr and RawArray * Merge ArrayPtr back into RawArray * Cleanup and explanations for RawArray::{dims_mut, nulls} * Add hint about lens * Remove unnecessary unsafe on test * Lift remarks into public docs Includes links that are permanent to some version of Postgres. * One last cleanup * Remove dubious dims_mut function Co-authored-by: Jubilee Young <[email protected]> Co-authored-by: Jubilee <[email protected]>
- Loading branch information
1 parent
ab650e6
commit 1d80c95
Showing
4 changed files
with
381 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.