Skip to content

Latest commit

 

History

History
119 lines (76 loc) · 3.88 KB

UPGRADING.md

File metadata and controls

119 lines (76 loc) · 3.88 KB

Upgrade Guide

This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the changelog.

9.0.0

Legacy range options have been removed (Level/community#86). If you previously did:

db.createReadStream({ start: 'a', end: 'z' })

An error would now be thrown and you must instead do:

db.createReadStream({ gte: 'a', lte: 'z' })

The same applies to db.iterator(), db.createKeyStream() and db.createValueStream().

This release also drops support of legacy runtime environments (Level/community#98):

  • Node.js 8
  • Internet Explorer 11
  • Safari 9-11
  • Stock Android browser (AOSP).

8.0.0

Upgraded to level-js@5 and memdown@5 which have the same breaking change:

Support of keys & values other than strings and Buffers has been dropped. Internally [memdown and level-js] now store keys & values as binary which solves a number of compatibility issues (Level/memdown#186). If you pass in a key or value that isn't a string or Buffer, it will be irreversibly stringified.

7.0.0

Dropped node 6 and removed the defunct clean option.

6.0.0

Upgraded to leveldown@5, level-js@4 and memdown@4, now all based on abstract-leveldown@6. For more information please see:

Please note that leveldown (which is an optional dependency) now requires node >= 8.6.0.

5.0.0

Dropped node 9 and removed name parameter from constructor in favor of randomly generated unique names. If you previously did:

const level = require('level-test')()
const db = level('foo', { valueEncoding: 'json' })

You must now do:

const level = require('level-test')()
const db = level({ valueEncoding: 'json' })

4.0.0

We updated level-js to v3.0.0 with changes to browser support, which warranted a new major version.

For more information please see:

3.0.0

Dropped support for node 0.10.


If you are using level-test with a custom backend, this API has changed.

If you previously did:

var hyper = require('leveldown-hyper')
var level = require('level-test')({ db: hyper })
var db = level('foo', { encoding: 'json' })

You should now do:

var hyper = require('leveldown-hyper')
var level = require('level-test')(hyper)
var db = level('foo', { encoding: 'json' })

This contains upgrade to leveldown@~3.0.0 which is based on abstract-leveldown@~4.0.0 which in turn contains breaking changes to .batch().


Internally this package now depends on level-packager@2 which in turn is based on levelup@2 which gives us native Promise support.

var level = require('level-test')()
var db = level()
await db.put('foo', 'bar')
console.log(await db.get('foo'))

This does not affect the existing callback API, functionality-wise or performance-wise.

For more information please check the corresponding CHANGELOG.md for: