ueberdb2 4.1.8 → 4.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/databases/cassandra_db.js +233 -235
- package/dist/databases/couch_db.js +171 -173
- package/dist/databases/dirty_db.js +73 -76
- package/dist/databases/dirty_git_db.js +57 -75
- package/dist/databases/elasticsearch_db.js +241 -267
- package/dist/databases/memory_db.js +35 -37
- package/dist/databases/mock_db.js +36 -38
- package/dist/databases/mongodb_db.js +131 -133
- package/dist/databases/mssql_db.js +183 -185
- package/dist/databases/mysql_db.js +166 -168
- package/dist/databases/postgres_db.js +188 -190
- package/dist/databases/postgrespool_db.js +10 -10
- package/dist/databases/redis_db.js +118 -120
- package/dist/databases/rethink_db.js +119 -121
- package/dist/databases/sqlite_db.js +135 -137
- package/dist/index.js +195 -213
- package/lib/AbstractDatabase.ts +79 -0
- package/lib/CacheAndBufferLayer.ts +665 -0
- package/lib/logging.ts +32 -0
- package/package.json +16 -12
- package/dist/lib/AbstractDatabase.js +0 -38
- package/dist/lib/CacheAndBufferLayer.js +0 -657
- package/dist/lib/logging.js +0 -34
- package/dist/test/lib/databases.js +0 -74
- package/dist/test/test.js +0 -327
- package/dist/test/test_bulk.js +0 -74
- package/dist/test/test_elasticsearch.js +0 -157
- package/dist/test/test_findKeys.js +0 -69
- package/dist/test/test_flush.js +0 -83
- package/dist/test/test_getSub.js +0 -57
- package/dist/test/test_lru.js +0 -155
- package/dist/test/test_memory.js +0 -59
- package/dist/test/test_metrics.js +0 -772
- package/dist/test/test_mysql.js +0 -90
- package/dist/test/test_postgres.js +0 -40
- package/dist/test/test_setSub.js +0 -48
- package/dist/test/test_tojson.js +0 -62
|
@@ -1,175 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.settings =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
$
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.
|
|
170
|
-
|
|
171
|
-
this.agent.destroy();
|
|
172
|
-
this.agent = null;
|
|
173
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AbstractDatabase = require('../lib/AbstractDatabase.js');
|
|
4
|
+
var http = require('http');
|
|
5
|
+
var nano = require('nano');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 2012 Max 'Azul' Wiehle
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS-IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
const Database = class Couch_db extends AbstractDatabase {
|
|
23
|
+
agent;
|
|
24
|
+
db;
|
|
25
|
+
constructor(settings) {
|
|
26
|
+
super();
|
|
27
|
+
this.agent = null;
|
|
28
|
+
this.db = null;
|
|
29
|
+
this.settings = settings;
|
|
30
|
+
// force some settings
|
|
31
|
+
// used by CacheAndBufferLayer.js
|
|
32
|
+
this.settings.cache = 1000;
|
|
33
|
+
this.settings.writeInterval = 100;
|
|
34
|
+
this.settings.json = false;
|
|
35
|
+
}
|
|
36
|
+
get isAsync() { return true; }
|
|
37
|
+
async init() {
|
|
38
|
+
this.agent = new http.Agent({
|
|
39
|
+
keepAlive: true,
|
|
40
|
+
maxSockets: this.settings.maxListeners || 1,
|
|
41
|
+
});
|
|
42
|
+
const coudhDBSettings = {
|
|
43
|
+
url: `http://${this.settings.host}:${this.settings.port}`,
|
|
44
|
+
requestDefaults: {
|
|
45
|
+
agent: this.agent,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
if (this.settings.user && this.settings.password) {
|
|
49
|
+
coudhDBSettings.requestDefaults.auth = {
|
|
50
|
+
username: this.settings.user,
|
|
51
|
+
password: this.settings.password,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const client = nano(coudhDBSettings);
|
|
55
|
+
try {
|
|
56
|
+
await client.db.get(this.settings.database);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
if (err.statusCode !== 404)
|
|
60
|
+
throw err;
|
|
61
|
+
await client.db.create(this.settings.database);
|
|
62
|
+
}
|
|
63
|
+
this.db = client.use(this.settings.database);
|
|
64
|
+
}
|
|
65
|
+
async get(key) {
|
|
66
|
+
let doc;
|
|
67
|
+
try {
|
|
68
|
+
if (this.db) {
|
|
69
|
+
doc = await this.db.get(key);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
if (err.statusCode === 404)
|
|
74
|
+
return null;
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
if (doc && 'value' in doc) {
|
|
78
|
+
return doc.value;
|
|
79
|
+
}
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
async findKeys(key, notKey) {
|
|
83
|
+
const pfxLen = key.indexOf('*');
|
|
84
|
+
if (!this.db) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const pfx = pfxLen < 0 ? key : key.slice(0, pfxLen);
|
|
88
|
+
const results = await this.db.find({
|
|
89
|
+
selector: {
|
|
90
|
+
_id: pfxLen < 0 ? pfx : {
|
|
91
|
+
$gte: pfx,
|
|
92
|
+
// https://docs.couchdb.org/en/3.2.2/ddocs/views/collation.html#string-ranges
|
|
93
|
+
$lte: `${pfx}\ufff0`,
|
|
94
|
+
$regex: this.createFindRegex(key, notKey).source,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
fields: ['_id'],
|
|
98
|
+
});
|
|
99
|
+
return results.docs.map((doc) => doc._id);
|
|
100
|
+
}
|
|
101
|
+
async set(key, value) {
|
|
102
|
+
let doc;
|
|
103
|
+
if (!this.db) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
doc = await this.db.get(key);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (err.statusCode !== 404)
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
await this.db.insert({
|
|
114
|
+
_id: key,
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
value,
|
|
117
|
+
...doc == null ? {} : {
|
|
118
|
+
_rev: doc._rev,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async remove(key) {
|
|
123
|
+
let header;
|
|
124
|
+
if (!this.db) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
header = await this.db.head(key);
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
if (err.statusCode === 404)
|
|
132
|
+
return;
|
|
133
|
+
throw err;
|
|
134
|
+
}
|
|
135
|
+
// etag has additional quotation marks, remove them
|
|
136
|
+
const etag = JSON.parse(header.etag);
|
|
137
|
+
await this.db.destroy(key, etag);
|
|
138
|
+
}
|
|
139
|
+
async doBulk(bulk) {
|
|
140
|
+
if (!this.db) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const keys = bulk.map((op) => op.key);
|
|
144
|
+
const revs = {};
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
for (const { key, value } of (await this.db.fetchRevs({ keys })).rows) {
|
|
147
|
+
// couchDB will return error instead of value if key does not exist
|
|
148
|
+
if (value != null)
|
|
149
|
+
revs[key] = value.rev;
|
|
150
|
+
}
|
|
151
|
+
const setters = [];
|
|
152
|
+
for (const item of bulk) {
|
|
153
|
+
const set = { _id: item.key, _rev: undefined,
|
|
154
|
+
_deleted: false, value: '' };
|
|
155
|
+
if (revs[item.key] != null)
|
|
156
|
+
set._rev = revs[item.key];
|
|
157
|
+
if (item.type === 'set')
|
|
158
|
+
set.value = item.value;
|
|
159
|
+
if (item.type === 'remove')
|
|
160
|
+
set._deleted = true;
|
|
161
|
+
setters.push(set);
|
|
162
|
+
}
|
|
163
|
+
await this.db.bulk({ docs: setters });
|
|
164
|
+
}
|
|
165
|
+
async close() {
|
|
166
|
+
this.db = null;
|
|
167
|
+
if (this.agent)
|
|
168
|
+
this.agent.destroy();
|
|
169
|
+
this.agent = null;
|
|
170
|
+
}
|
|
174
171
|
};
|
|
172
|
+
|
|
175
173
|
exports.Database = Database;
|
|
@@ -1,78 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.settings =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.db
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.db = null;
|
|
74
|
-
if (callback)
|
|
75
|
-
callback();
|
|
76
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AbstractDatabase = require('../lib/AbstractDatabase.js');
|
|
4
|
+
var Dirty = require('dirty');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 2011 Peter 'Pita' Martischka
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS-IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
/*
|
|
22
|
+
*
|
|
23
|
+
* Fair warning that length may not provide the correct value upon load.
|
|
24
|
+
* See https://github.com/ether/etherpad-lite/pull/3984
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
const Database = class extends AbstractDatabase {
|
|
28
|
+
db;
|
|
29
|
+
constructor(settings) {
|
|
30
|
+
super();
|
|
31
|
+
this.db = null;
|
|
32
|
+
if (!settings || !settings.filename) {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
settings = { filename: null };
|
|
35
|
+
}
|
|
36
|
+
this.settings = settings;
|
|
37
|
+
// set default settings
|
|
38
|
+
this.settings.cache = 0;
|
|
39
|
+
this.settings.writeInterval = 0;
|
|
40
|
+
this.settings.json = false;
|
|
41
|
+
}
|
|
42
|
+
init(callback) {
|
|
43
|
+
this.db = new Dirty(this.settings.filename);
|
|
44
|
+
this.db.on('load', (err) => {
|
|
45
|
+
callback();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
get(key, callback) {
|
|
49
|
+
callback(null, this.db.get(key));
|
|
50
|
+
}
|
|
51
|
+
findKeys(key, notKey, callback) {
|
|
52
|
+
const keys = [];
|
|
53
|
+
const regex = this.createFindRegex(key, notKey);
|
|
54
|
+
this.db.forEach((key, val) => {
|
|
55
|
+
if (key.search(regex) !== -1) {
|
|
56
|
+
keys.push(key);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
callback(null, keys);
|
|
60
|
+
}
|
|
61
|
+
set(key, value, callback) {
|
|
62
|
+
this.db.set(key, value, callback);
|
|
63
|
+
}
|
|
64
|
+
remove(key, callback) {
|
|
65
|
+
this.db.rm(key, callback);
|
|
66
|
+
}
|
|
67
|
+
close(callback) {
|
|
68
|
+
this.db.close();
|
|
69
|
+
this.db = null;
|
|
70
|
+
if (callback)
|
|
71
|
+
callback();
|
|
72
|
+
}
|
|
77
73
|
};
|
|
74
|
+
|
|
78
75
|
exports.Database = Database;
|
|
@@ -1,77 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
this.db
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
callback(null, keys);
|
|
58
|
-
}
|
|
59
|
-
set(key, value, callback) {
|
|
60
|
-
this.db.set(key, value, callback);
|
|
61
|
-
const databasePath = require('path').dirname(this.settings.filename);
|
|
62
|
-
require('simple-git')(databasePath)
|
|
63
|
-
.silent(true)
|
|
64
|
-
.add('./*.db')
|
|
65
|
-
.commit('Automated commit...')
|
|
66
|
-
.push(['-u', 'origin', 'master'], () => console.debug('Stored git commit'));
|
|
67
|
-
}
|
|
68
|
-
remove(key, callback) {
|
|
69
|
-
this.db.rm(key, callback);
|
|
70
|
-
}
|
|
71
|
-
close(callback) {
|
|
72
|
-
this.db.close();
|
|
73
|
-
if (callback)
|
|
74
|
-
callback();
|
|
75
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AbstractDatabase = require('../lib/AbstractDatabase.js');
|
|
4
|
+
var Dirty = require('dirty');
|
|
5
|
+
|
|
6
|
+
const Database = class extends AbstractDatabase {
|
|
7
|
+
db;
|
|
8
|
+
constructor(settings) {
|
|
9
|
+
super();
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
this.db = null;
|
|
12
|
+
if (!settings || !settings.filename) {
|
|
13
|
+
settings = {};
|
|
14
|
+
}
|
|
15
|
+
this.settings = settings;
|
|
16
|
+
// set default settings
|
|
17
|
+
this.settings.cache = 0;
|
|
18
|
+
this.settings.writeInterval = 0;
|
|
19
|
+
this.settings.json = false;
|
|
20
|
+
}
|
|
21
|
+
init(callback) {
|
|
22
|
+
this.db = new Dirty.Dirty(this.settings.filename);
|
|
23
|
+
this.db.on('load', (err) => {
|
|
24
|
+
callback();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get(key, callback) {
|
|
28
|
+
callback(null, this.db.get(key));
|
|
29
|
+
}
|
|
30
|
+
findKeys(key, notKey, callback) {
|
|
31
|
+
const keys = [];
|
|
32
|
+
const regex = this.createFindRegex(key, notKey);
|
|
33
|
+
this.db.forEach((key, val) => {
|
|
34
|
+
if (key.search(regex) !== -1) {
|
|
35
|
+
keys.push(key);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
callback(null, keys);
|
|
39
|
+
}
|
|
40
|
+
set(key, value, callback) {
|
|
41
|
+
this.db.set(key, value, callback);
|
|
42
|
+
const databasePath = require('path').dirname(this.settings.filename);
|
|
43
|
+
require('simple-git')(databasePath)
|
|
44
|
+
.silent(true)
|
|
45
|
+
.add('./*.db')
|
|
46
|
+
.commit('Automated commit...')
|
|
47
|
+
.push(['-u', 'origin', 'master'], () => console.debug('Stored git commit'));
|
|
48
|
+
}
|
|
49
|
+
remove(key, callback) {
|
|
50
|
+
this.db.rm(key, callback);
|
|
51
|
+
}
|
|
52
|
+
close(callback) {
|
|
53
|
+
this.db.close();
|
|
54
|
+
if (callback)
|
|
55
|
+
callback();
|
|
56
|
+
}
|
|
76
57
|
};
|
|
58
|
+
|
|
77
59
|
exports.Database = Database;
|