-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update to abstract-leveldown 4 and levelup 2 #7
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- 4 | ||
- 6 | ||
- 8 | ||
- 9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,18 @@ var memdown = require('memdown') | |
var subdown = require('../leveldown') | ||
var levelup = require('levelup') | ||
var testCommon = require('./common') | ||
var testBuffer = new Buffer('this-is-test-data') | ||
|
||
require('abstract-leveldown/abstract/open-test').args(down, test, testCommon) | ||
require('abstract-leveldown/abstract/open-test').open(down, test, testCommon) | ||
require('abstract-leveldown/abstract/del-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/get-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/put-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/put-get-del-test').all(down, test, testCommon, testBuffer) | ||
require('abstract-leveldown/abstract/put-get-del-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/batch-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/chained-batch-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/close-test').close(down, test, testCommon) | ||
require('abstract-leveldown/abstract/iterator-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/ranges-test').all(down, test, testCommon) | ||
require('abstract-leveldown/abstract/iterator-range-test').all(down, test, testCommon) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @finnp Did you have any help of the upgrade guide in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I had a look at it, that was quite helpful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's awesome to hear! It paid off :) |
||
|
||
function down (loc) { | ||
return subdown(levelup(loc, {db: memdown}), 'test') | ||
return subdown(levelup(memdown()), 'test') | ||
} |
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.
@vweevers What if we did
levelup(encoding(subdown(db, prefix, opts)), opts)
here instead?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.
Should work, yeah, with one addition: also pass
opts
toencoding()
.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.
What happens with
deferred-leveldown
though? Wouldn't every (sub)db be wrapped needlessly?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.
Hmm, not following you. That's already the case?
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.
It is? OK, then never mind, we can optimize that later if we want
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.
Aye, so each
levelup
has its owndeferred-leveldown
andsubleveldown
just returns a newlevelup
so nothing has changed there.But I agree, it's a bit overhead maybe. Not sure what we can do about it since it's part of
levelup
.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.
Commenting on my own comment 😄
This is exactly what
level
does, so we could probably do: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.
Scratch my last comment. I meant using
level-packager
which wraps withlevelup
andencoding-down
.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.
This hurts my brain :)
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're not alone :)