-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
range options should be serialized #130
Comments
Would be nice to know what happened here. Has this always been the case or did we break it? |
Has been the case since the |
But no one has been bitten by this yet, it seems |
Even before |
@juliangruber can you think of any reason why this has been the case since forever? Are we missing something? |
the null / undefined, buffer / utf8 etc situation was weird to me from the very beginning, and no one ever really understood the whole picture iirc |
same as for example the |
Maybe we could write some tests for it to to illustrate when it happens. What is the exact usage of the serialization code when doing |
So far I can't actually think of a use case that would fail without range option serialization. It merely feels like the right thing to do. I know two Buffers can become equal when serialized to (UTF8) strings: Buffer('90', 'hex').toString() === Buffer('80', 'hex').toString() Maybe we can find something there, some case where the sort order is off. |
Then again, if we need to actively search for issues.. |
If nothing else, I think it's a safety mechanism. In normal use of db.createReadStream({ gt: 2 }) The In case it is not, In the case of db.batch([
{ key: 1, value: 'one' },
{ key: 2, value: 'two' }
], function (err) {
db.createKeyStream({ gt: 2 }).on('data', function (key) {
console.log(key)
})
}) |
Makes sense because encodings used to be built-in, so users were protected against the above scenario (unless they used the |
@juliangruber @ralphtheninja in conclusion, I do think we need this, but it's not a priority. 🦆 |
Found a use case. If |
See #121 (comment).
@ralphtheninja @juliangruber should we include this in
levelup@2
? If so I can try to tackle this today/tomorrow.The text was updated successfully, but these errors were encountered: