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

Node binding: keep strings as binary data #1563

Merged
merged 5 commits into from
Jun 16, 2024

Conversation

eifrah-aws
Copy link
Contributor

This PR does the following:

  • Any string value returning from Rust core, is kept in its binary form and is converted into TypeScript Uint8Array data structure
  • Fixed all tests to work with binary strings (added various utilities like checkSimple and 2 conversion methods intoString and intoArray)
  • Changed set API to accept BulkString (a union of string | Uint8Array)

@eifrah-aws eifrah-aws requested a review from a team as a code owner June 13, 2024 14:16
@Yury-Fridlyand Yury-Fridlyand added the node Node.js wrapper label Jun 13, 2024
Copy link
Collaborator

@avifenesh avifenesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now as a user if i want the result as string i need to convert them?

node/tests/TestUtilities.ts Show resolved Hide resolved
@eifrah-aws eifrah-aws force-pushed the node-binary-support-fix-tests branch from fa0d7e6 to 698583f Compare June 16, 2024 07:45
@eifrah-aws eifrah-aws merged commit 7df2498 into valkey-io:main Jun 16, 2024
8 checks passed
@eifrah-aws eifrah-aws deleted the node-binary-support-fix-tests branch June 17, 2024 12:17
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Node binding: string values returning from Rust core, are preserved as binary data
Node: tests are fixed to handle binary strings returned from Rust core

* Fixed linter issues

* More linter fixes

* When converting Set into Array, sort the items

* stlye fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node Node.js wrapper
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants