-
-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
lgtm i guess for the null value problem we could use some special string with escaping |
Yes. Or wrap everything in a simple object. Would you like to assemble
|
ok 2.2.1 is out with |
i started fixing bugs, i'll post my progress later today |
I've opened an issue against IDBWrapper, maybe we should just add a method/argument there. |
@mcollina Going through old IDBWrapper issues, and found this: jensarps/IDBWrapper#63 Feel free to get back to me over there! |
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
To complement jensarps comment on Chrome, I've noticed Firefox 46.0a2 can return undefined as well, so not only null. See this patch timkuijsten@18965a8 |
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
Based on PR #51 I've started testing with abstract-leveldown2 and found that most tests succeed. I've fixed all remaining failing tests. I cannot reproduce the problems with undefined versus null values, Firefox 46.0a2 does return undefined as well as Chrome, not null for values that do not exist. Some abstract tests require to differentiate between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. Therefore I'm using IDB.iterate with a keyRange in _get now. The work is ready to be merged and lives in https://github.com/timkuijsten/level.js/tree/abstract-level2. I'm currently proceeding with #46 and I'm not sure if I should already open up a PR for bumping the deps to abstract-level2 or wait until #46 is finished? |
this would be a major anyway, if #46 is close by, let's just jump there. Also, it would be really good to have zuul+saucelabs to run tests on all
|
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
abstract-level requires differentiation between undefined as a value and not exists. The IndexedDB API has a note explaining openCursor can be used for this instead of get. refs Level#41
@timkuijsten i'm playing with your branch, and though the tests do pass, levelup's createReadStream never gets past the first value (and never emits 'end'). Could you take a look? I added the test to this fork https://github.com/mvayngrib/level.js/tree/al2: tape.only('read stream', function (t) {
var level = levelup('read-stream-test', {db: leveljs})
var batch = new Array(2).fill(null).map(function (whatever, i) {
return {
type: 'put',
key: '' + i,
value: '' + i
}
})
level.batch(batch, function (err) {
if (err) throw err
const data = []
level.createReadStream()
.on('data', function (item) {
data.push(item)
})
.on('error', t.error)
.on('end', function () {
t.same(data, batch.map(function (row) {
return {
key: row.key,
value: row.value
}
}))
t.end()
})
})
}) |
Hi @mvayngrib, I can reproduce that your test doesn't finish on the abstract-leveldown2 branch. However, it should be noted that most of my effort went into the idbunwrapper branch. I've tested your test on that branch and it does pass successfully. I'm starting to use the idunwrapper code more and more, so far so good. Maybe you can try out that branch? https://github.com/timkuijsten/level.js/tree/idbunwrapper |
@timkuijsten actually i tried the idbunwrapper branch first :) The problem I had there was unsupported Buffer keys. |
@timkuijsten scratch that, i don't experience that issue (with Buffer keys) anymore, must have been a bug on my side. Will get back to you if something doesn't work for me |
@mvayngrib just pushed a big update into my idbunwrapper branch that could use some extra testing if you'd like. |
@timkuijsten great, i'll give it a try! |
@vweevers Can we close this as is or do you want to supersede it by something first? |
Yeah, we'll get to this "automatically". |
This partially solves the problems with AbstractLevelDown 2 (at least the initialization)
Unfortunately, the new feature "support for
null
values", needs to be implemented in a not-backward compatible way. Basically IDBWrapper returnsnull
if a key is not found, so it is impossible to tell if the specified value isnull
or if there is no key.I am not sure if exposing this difference in IDBWrapper is possible, and I had no time to look at this issue further
I recommend:
Also cc @JamesKyburz and @jprichardson @juliangruber