-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fix db init #95
Fix db init #95
Conversation
alright, Is this backwards-compatible? Or should it be a different major version |
@Ivshti from level up readme
It should be backwards-compatible. But, now that you are asking, maybe a major version would be better to avoid issues |
Definitely a major version bump |
This will break level-js compatibility, because the db parameter of the options is no longer used to specify the underlying database used by levelup - this is the point of the API change in levelup. Also recommend the options get passed to encode so encoding options can be specified, in the same manner as the level package via level-packager does. Something along the lines of: var options = this.options.store || { };
var db = options.db || leveldown;
this.store = stores[path.resolve(filename)] = (this.store && this.store.isOpen()) ? this.store : levelup(encode(db(filename), options), options); |
Hi, I just noticed that you have add leveldown dependency in your PR which give me the following error on install Does upgrading oblige user to move on to leveldown in project where we are using level-js instead ? |
@orlandodemauro I think the changes to model.js forces leveldown to exist, since it now gets required - this is a problem in environments where leveldown is unavailable (ie: pure JS with no binaries). Quick fix should be to wrap a try-catch block around just the leveldown require, then change the initStore function to throw an error if db is null (leveldown is unavailable, and no alternative is provided). |
@orlandodemauro and maybe move leveldown to devDependecies instead of dependencies for those who are actually using level-js |
Has this commit been pushed to NPM? I still get an old version of Model.js when doing npm install. |
When will it be publish ti NPM? I'm still facing same issue #101 |
done, published v3.26.0: https://www.npmjs.com/package/linvodb3 |
thank you so much.. |
fixes #94
@Ivshti the version 3.25.2 is broken due to a change in the levelup constructor API.
for more info https://github.com/Level/levelup/blob/master/UPGRADING.md