@live-change/db-store-lmdb 0.6.23 → 0.7.0
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/index.js +2 -1
- package/lib/Store.js +5 -4
- package/package.json +7 -5
- package/tests/count-observable.js +9 -11
- package/tests/limited-range-observable.js +8 -10
- package/tests/limited-reverse-range-observable.js +12 -11
- package/tests/object-observable.js +7 -9
- package/tests/range-observable.js +7 -9
- package/tests/reverse-range-observable.js +7 -9
- package/tests/store-non-reactive.js +7 -12
package/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import Store from './lib/Store.js'
|
|
2
|
+
export default Store
|
package/lib/Store.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import IntervalTreeLib from '@live-change/interval-tree'
|
|
2
|
+
const IntervalTree = IntervalTreeLib.default
|
|
3
|
+
import ReactiveDao from "@live-change/dao"
|
|
4
|
+
import lmdb from 'node-lmdb'
|
|
4
5
|
|
|
5
6
|
class ObjectObservable extends ReactiveDao.ObservableValue {
|
|
6
7
|
constructor(store, key) {
|
|
@@ -648,4 +649,4 @@ class Store {
|
|
|
648
649
|
|
|
649
650
|
}
|
|
650
651
|
|
|
651
|
-
|
|
652
|
+
export default Store
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-store-lmdb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,15 +20,17 @@
|
|
|
20
20
|
"url": "https://github.com/live-change/live-change-db/issues"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-db",
|
|
23
|
+
"type": "module",
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"rimraf": "^
|
|
25
|
-
"tape": "^5.
|
|
25
|
+
"rimraf": "^5.0.5",
|
|
26
|
+
"tape": "^5.7.4"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@live-change/dao": "0.5.22",
|
|
29
30
|
"@live-change/interval-tree": "^1.0.12",
|
|
30
31
|
"napi-macros": "^2.0.0",
|
|
31
|
-
"node-lmdb": "^0.9.6"
|
|
32
|
+
"node-lmdb": "^0.9.6",
|
|
33
|
+
"p-queue": "^7.3.4"
|
|
32
34
|
},
|
|
33
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b372725d436e29f7cc66b811533009c9ea5330a1"
|
|
34
36
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
|
-
const dbPath = `./test.
|
|
8
|
+
const dbPath = `./test.co.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
10
10
|
fs.mkdirSync(dbPath)
|
|
11
|
-
const env = new lmdb.Env()
|
|
11
|
+
const env = new lmdb.Env()
|
|
12
12
|
env.open({
|
|
13
13
|
// Path to the environment
|
|
14
14
|
path: dbPath,
|
|
@@ -140,9 +140,7 @@ test("store count observable", t => {
|
|
|
140
140
|
t.plan(1)
|
|
141
141
|
dbi.close()
|
|
142
142
|
env.close()
|
|
143
|
-
rimraf(dbPath
|
|
144
|
-
|
|
145
|
-
t.pass('removed')
|
|
146
|
-
})
|
|
143
|
+
await rimraf(dbPath)
|
|
144
|
+
t.pass('removed')
|
|
147
145
|
})
|
|
148
146
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
8
|
const dbPath = `./test.lro.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
10
10
|
fs.mkdirSync(dbPath)
|
|
11
|
-
const env = new lmdb.Env()
|
|
11
|
+
const env = new lmdb.Env()
|
|
12
12
|
env.open({
|
|
13
13
|
// Path to the environment
|
|
14
14
|
path: dbPath,
|
|
@@ -174,9 +174,7 @@ test("store range observable", t => {
|
|
|
174
174
|
t.plan(1)
|
|
175
175
|
dbi.close()
|
|
176
176
|
env.close()
|
|
177
|
-
rimraf(dbPath
|
|
178
|
-
|
|
179
|
-
t.pass('removed')
|
|
180
|
-
})
|
|
177
|
+
await rimraf(dbPath)
|
|
178
|
+
t.pass('removed')
|
|
181
179
|
})
|
|
182
180
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
|
-
const dbPath = `./test.
|
|
8
|
+
const dbPath = `./test.lrro.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
10
10
|
fs.mkdirSync(dbPath)
|
|
11
|
-
const env = new lmdb.Env()
|
|
11
|
+
const env = new lmdb.Env()
|
|
12
12
|
env.open({
|
|
13
13
|
// Path to the environment
|
|
14
14
|
path: dbPath,
|
|
@@ -117,6 +117,7 @@ test("store range observable", t => {
|
|
|
117
117
|
rangeObservable.unobserve(rangeObserver)
|
|
118
118
|
t.pass('unobserved')
|
|
119
119
|
})
|
|
120
|
+
|
|
120
121
|
})
|
|
121
122
|
|
|
122
123
|
t.test("observe reverse range (b_5,b_0)", async t => {
|
|
@@ -168,15 +169,15 @@ test("store range observable", t => {
|
|
|
168
169
|
rangeObservable.unobserve(rangeObserver)
|
|
169
170
|
t.pass('unobserved')
|
|
170
171
|
})
|
|
172
|
+
|
|
171
173
|
})
|
|
172
174
|
|
|
173
175
|
t.test("close and remove database", async t => {
|
|
174
176
|
t.plan(1)
|
|
175
177
|
dbi.close()
|
|
176
178
|
env.close()
|
|
177
|
-
rimraf(dbPath
|
|
178
|
-
|
|
179
|
-
t.pass('removed')
|
|
180
|
-
})
|
|
179
|
+
await rimraf(dbPath)
|
|
180
|
+
t.pass('removed')
|
|
181
181
|
})
|
|
182
|
+
|
|
182
183
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
8
|
const dbPath = `./test.oo.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
@@ -74,9 +74,7 @@ test("store object observable", t => {
|
|
|
74
74
|
t.plan(1)
|
|
75
75
|
dbi.close()
|
|
76
76
|
env.close()
|
|
77
|
-
rimraf(dbPath
|
|
78
|
-
|
|
79
|
-
t.pass('removed')
|
|
80
|
-
})
|
|
77
|
+
await rimraf(dbPath)
|
|
78
|
+
t.pass('removed')
|
|
81
79
|
})
|
|
82
80
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
8
|
const dbPath = `./test.ro.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
@@ -140,9 +140,7 @@ test("store range observable", t => {
|
|
|
140
140
|
t.plan(1)
|
|
141
141
|
dbi.close()
|
|
142
142
|
env.close()
|
|
143
|
-
rimraf(dbPath
|
|
144
|
-
|
|
145
|
-
t.pass('removed')
|
|
146
|
-
})
|
|
143
|
+
await rimraf(dbPath)
|
|
144
|
+
t.pass('removed')
|
|
147
145
|
})
|
|
148
146
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
8
|
const dbPath = `./test.ro.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
@@ -140,9 +140,7 @@ test("store range observable", t => {
|
|
|
140
140
|
t.plan(1)
|
|
141
141
|
dbi.close()
|
|
142
142
|
env.close()
|
|
143
|
-
rimraf(dbPath
|
|
144
|
-
|
|
145
|
-
t.pass('removed')
|
|
146
|
-
})
|
|
143
|
+
await rimraf(dbPath)
|
|
144
|
+
t.pass('removed')
|
|
147
145
|
})
|
|
148
146
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import test from 'tape'
|
|
2
|
+
import lmdb from 'node-lmdb'
|
|
3
|
+
import { rimraf } from 'rimraf'
|
|
4
|
+
import fs from 'fs'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import Store from '../lib/Store.js'
|
|
7
7
|
|
|
8
8
|
const dbPath = `./test.nr.db`
|
|
9
9
|
rimraf.sync(dbPath)
|
|
@@ -155,12 +155,7 @@ test("store non-reactive properties", t => {
|
|
|
155
155
|
t.plan(1)
|
|
156
156
|
dbi.close()
|
|
157
157
|
env.close()
|
|
158
|
-
await
|
|
159
|
-
|
|
160
|
-
if(err) return t.fail(err)
|
|
161
|
-
t.pass('removed')
|
|
162
|
-
resolve()
|
|
163
|
-
})
|
|
164
|
-
})
|
|
158
|
+
await rimraf(dbPath)
|
|
159
|
+
t.pass('removed')
|
|
165
160
|
})
|
|
166
161
|
})
|