Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sending ArrayBuffer values over the wire #3323

Open
s-devaney opened this issue Sep 30, 2024 · 0 comments
Open

Support sending ArrayBuffer values over the wire #3323

s-devaney opened this issue Sep 30, 2024 · 0 comments

Comments

@s-devaney
Copy link

PG supports sending ArrayBuffer views (e.g. TypedArray instances like Uint8Array) over the wire as values in queries, but it cannot send the underlying ArrayBuffer as a value.

Use case: I have one ArrayBuffer which represents packed binary data, it containing multiple TypedArray views e.g. one UInt8Array for meta data and one Float32Array containing a payload.

I want to insert this entire ArrayBuffer into a Postgres BYTEA column.

But, currently, the PG prepareValue util function does not support preparing ArrayBuffer values.

Preparing an ArrayBuffer is a simple change, it can just be converted to a Buffer by simply passing it to Buffer.from()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant