ldb: minor.
This commit is contained in:
parent
b346397449
commit
27ba246027
@ -35,9 +35,11 @@ function ldb(options) {
|
|||||||
utils.mkdir(target.location, true);
|
utils.mkdir(target.location, true);
|
||||||
|
|
||||||
return new LowlevelUp(target.location, {
|
return new LowlevelUp(target.location, {
|
||||||
// LevelDB and others
|
// Generic
|
||||||
createIfMissing: options.createIfMissing !== false,
|
createIfMissing: options.createIfMissing !== false,
|
||||||
errorIfExists: options.errorIfExists === true,
|
errorIfExists: options.errorIfExists === true,
|
||||||
|
|
||||||
|
// LevelDB
|
||||||
compression: options.compression !== false,
|
compression: options.compression !== false,
|
||||||
cacheSize: options.cacheSize || (8 << 20),
|
cacheSize: options.cacheSize || (8 << 20),
|
||||||
writeBufferSize: options.writeBufferSize || (4 << 20),
|
writeBufferSize: options.writeBufferSize || (4 << 20),
|
||||||
@ -45,13 +47,13 @@ function ldb(options) {
|
|||||||
paranoidChecks: false,
|
paranoidChecks: false,
|
||||||
memory: false,
|
memory: false,
|
||||||
|
|
||||||
// For LMDB if we decide to use it:
|
// LMDB
|
||||||
sync: options.sync || false,
|
sync: options.sync || false,
|
||||||
mapSize: options.mapSize || 10 * (1024 << 20),
|
mapSize: options.mapSize || 256 * (1024 << 20),
|
||||||
writeMap: options.writeMap || false,
|
writeMap: options.writeMap || false,
|
||||||
noSubdir: options.noSubdir !== false,
|
noSubdir: options.noSubdir !== false,
|
||||||
|
|
||||||
// For browser buffer keys
|
// Browser
|
||||||
bufferKeys: options.bufferKeys,
|
bufferKeys: options.bufferKeys,
|
||||||
|
|
||||||
db: target.db
|
db: target.db
|
||||||
@ -88,6 +90,7 @@ ldb.getBackend = function getBackend(db) {
|
|||||||
name = 'lmdb';
|
name = 'lmdb';
|
||||||
ext = 'mdb';
|
ext = 'mdb';
|
||||||
break;
|
break;
|
||||||
|
case 'mem':
|
||||||
case 'memory':
|
case 'memory':
|
||||||
case 'rbt':
|
case 'rbt':
|
||||||
name = 'rbt';
|
name = 'rbt';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user