From 27ba246027580e8c0825ef2ae9549453e722c821 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 11 Sep 2016 02:25:06 -0700 Subject: [PATCH] ldb: minor. --- lib/db/ldb.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/db/ldb.js b/lib/db/ldb.js index 7f389456..5376893b 100644 --- a/lib/db/ldb.js +++ b/lib/db/ldb.js @@ -35,9 +35,11 @@ function ldb(options) { utils.mkdir(target.location, true); return new LowlevelUp(target.location, { - // LevelDB and others + // Generic createIfMissing: options.createIfMissing !== false, errorIfExists: options.errorIfExists === true, + + // LevelDB compression: options.compression !== false, cacheSize: options.cacheSize || (8 << 20), writeBufferSize: options.writeBufferSize || (4 << 20), @@ -45,13 +47,13 @@ function ldb(options) { paranoidChecks: false, memory: false, - // For LMDB if we decide to use it: + // LMDB sync: options.sync || false, - mapSize: options.mapSize || 10 * (1024 << 20), + mapSize: options.mapSize || 256 * (1024 << 20), writeMap: options.writeMap || false, noSubdir: options.noSubdir !== false, - // For browser buffer keys + // Browser bufferKeys: options.bufferKeys, db: target.db @@ -88,6 +90,7 @@ ldb.getBackend = function getBackend(db) { name = 'lmdb'; ext = 'mdb'; break; + case 'mem': case 'memory': case 'rbt': name = 'rbt';