Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(nodejs): add
WriteOptions
for write methods #4785feat(nodejs): add
WriteOptions
for write methods #4785Changes from 3 commits
e61eb95
5f1ab79
2311bce
fb83098
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you effort. But
OpXxx
is not an existing concept at the binding side. How about usingWriteOptions
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, the
OpWriteOptions
concept corresponds toOpWrite
, so I think it's better to use one object notOpWriteOptions
,OpWriterOptions
the name starts with
Op
also because of this, butWriteOptions
is ok for meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your understanding is correct. But there is a gap between rust core and nodejs binding.
Rust Core users have a concept called
OpXxx
likeOpWrite
andOpRead
. But we never expose those APIs to nodejs binding. So from the nodejs users view, they don't know aboutOpXxx
thus they can't understand what'sOpXxx
represents for.So I think it's better to use
WriteOptions
without theOp
prefix.And for
WriteOptions
andWriterOptions
, it's possible for the future to introduce different options insidewrite
andwriter
options. So I want to seperate them for now instead of another breaking changes in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's a comprehensive explanation, I will fix it ASAP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need
WriterOptions
too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I mentioned above, I think
WriteOptions
is enoughThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better not to play with those APIs. What do you think about adding bunch of
if-else
directly?This PR also makes me thinking about exporting
WriteOptions
from the rust core side. We can have a discussion there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can polish here in the future if rust core exposes
WriteOptions
directly.