nedb-engine 2.0.36 → 2.2.3
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/README.md +11 -9
- package/index.d.ts +10 -11
- package/nedb.darwin-arm64.node +0 -0
- package/nedb.darwin-x64.node +0 -0
- package/nedb.linux-x64-gnu.node +0 -0
- package/nedb.win32-x64-msvc.node +0 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,9 +19,11 @@ One Rust core → ships to **PyPI** and **npm** from a single source.
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
## v2 —
|
|
22
|
+
## NEDB v2.0.36 — Production Stable
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
**Current stable: 2.0.36** — Cross-platform native wheels shipping `nedbd-v2` binary inside `pip install nedb-engine`. Linux + Windows wheels built on GitHub Actions; macOS arm64 + x86_64 wheels built on Codemagic (M2 Mac Minis). All four platforms publish from one `v*` tag.
|
|
25
|
+
|
|
26
|
+
NEDB v2 replaces the append-only log (AOF) with a **content-addressed Merkle DAG**. Every document version is an immutable, BLAKE2b-verified object. Nothing is ever overwritten. As of **v2.0.36**, restarts after the first open are **O(1) warm starts** (driven by a `MANIFEST` of `seq` + Merkle head), the **cold scan is deferred** so the daemon accepts connections immediately, and a new **`GET /events` SSE endpoint** streams scan progress + per-write events live.
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
29
|
# Run the v2 DAG engine — ships inside pip install nedb-engine
|
|
@@ -30,9 +32,9 @@ nedbd --dag --data ./data
|
|
|
30
32
|
NEDBD_DAG=1 NEDB_TMK=<32-byte-hex> nedbd --data ./data
|
|
31
33
|
|
|
32
34
|
curl http://127.0.0.1:7070/health
|
|
33
|
-
# {"ok":true,"version":"2.0.
|
|
35
|
+
# {"ok":true,"version":"2.0.36","service":"nedbd","engine":"dag","startup_ready":true,"encrypted":true}
|
|
34
36
|
|
|
35
|
-
# Tail the live event stream (new in v2.0.
|
|
37
|
+
# Tail the live event stream (new in v2.0.36)
|
|
36
38
|
curl http://127.0.0.1:7070/events
|
|
37
39
|
# event: scan data: {"objects":730000,"of":1310703,"rate":21043,"eta_s":28}
|
|
38
40
|
# event: ready data: {"seq":1310703,"head":"b2:9c14e07a…"}
|
|
@@ -56,7 +58,7 @@ curl http://127.0.0.1:7070/events
|
|
|
56
58
|
|
|
57
59
|
**v1 AOF engine is still shipped and unchanged** — `nedbd` (no flag) runs v1.
|
|
58
60
|
|
|
59
|
-
**Production status:** [vision.interchained.org](https://vision.interchained.org) is live on v2.0.
|
|
61
|
+
**Production status:** [vision.interchained.org](https://vision.interchained.org) is live on v2.0.36 — **1,310,703 sequences** indexed in the Vision database, AES-256-GCM encrypted at rest, at block height **620,989**.
|
|
60
62
|
|
|
61
63
|
---
|
|
62
64
|
|
|
@@ -221,11 +223,11 @@ nedbd --dag --data ./data # v2 DAG engine (or NEDBD_DAG=1)
|
|
|
221
223
|
NEDBD_RESP2_PORT=6380 nedbd # also speak RESP2 (redis-cli compatible)
|
|
222
224
|
nedbd --log-level 2 # 0=errors 1=requests 2=deploy 3=verbose
|
|
223
225
|
|
|
224
|
-
# Live event stream (new in v2.0.
|
|
226
|
+
# Live event stream (new in v2.0.36) — SSE: scan progress, ready, per-write head
|
|
225
227
|
curl http://127.0.0.1:7070/events
|
|
226
228
|
```
|
|
227
229
|
|
|
228
|
-
### Startup modes (v2.0.
|
|
230
|
+
### Startup modes (v2.0.36)
|
|
229
231
|
|
|
230
232
|
- **Warm start** — every restart after the first open reads the `MANIFEST` file and restores `seq` + Merkle `head` in **O(1)**. No scan, no replay, independent of dataset size. Boots in milliseconds.
|
|
231
233
|
- **Cold start** — first open of an existing dataset spawns the integrity scan in a background thread *and accepts connections immediately*. Reads serve instantly from the content-addressed DAG; writes return `HTTP 503 startup in progress` until the `startup_ready` gate flips. Progress (objects, rate, ETA) streams over `GET /events`.
|
|
@@ -235,7 +237,7 @@ curl http://127.0.0.1:7070/events
|
|
|
235
237
|
| Variable | Default | Description |
|
|
236
238
|
|---|---|---|
|
|
237
239
|
| `NEDBD_DAG` | `0` | Set `1` to launch the v2 DAG engine (`nedbd-v2`). Same as `--dag`. |
|
|
238
|
-
| `NEDBD_HOST` | `127.0.0.1` | Bind address. **v2.0.
|
|
240
|
+
| `NEDBD_HOST` | `127.0.0.1` | Bind address. **v2.0.36** defaults to loopback (was `0.0.0.0`) — security hardening fix. Set explicitly to `0.0.0.0` to expose. |
|
|
239
241
|
| `NEDBD_PORT` | `7070` | HTTP bind port. |
|
|
240
242
|
| `NEDBD_TOKEN` | unset | Optional bearer token; required on every `/v1/*` request when set. |
|
|
241
243
|
| `NEDB_TMK` | unset | 32-byte hex AES-256-GCM at-rest encryption key. |
|
|
@@ -298,7 +300,7 @@ db.query('FROM policy AS OF 200 VALID AS OF "2024-02-15"')
|
|
|
298
300
|
|
|
299
301
|
## Performance
|
|
300
302
|
|
|
301
|
-
**v2 DAG Rust server (v2.0.
|
|
303
|
+
**v2 DAG Rust server (v2.0.36, Intel iMac — 10k writes / 100k reads / 30k objects, AES-256-GCM on):**
|
|
302
304
|
|
|
303
305
|
| Operation | Throughput | p50 | p99 |
|
|
304
306
|
|---|---|---|---|
|
package/index.d.ts
CHANGED
|
@@ -4,28 +4,26 @@
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
6
|
export declare class NedbCore {
|
|
7
|
-
/** Create an in-memory database. */
|
|
7
|
+
/** Create an in-memory v2 DAG database — zero disk I/O. */
|
|
8
8
|
constructor()
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Open a durable v2 DAG database at `path`.
|
|
11
|
+
* Automatically migrates v1 AOF → v2 DAG on first open.
|
|
12
|
+
*/
|
|
10
13
|
static open(path: string): NedbCore
|
|
11
14
|
createIndex(coll: string, field: string, kind: string): void
|
|
12
|
-
/**
|
|
15
|
+
/** Put a document. Returns the stored doc as a JSON string. */
|
|
13
16
|
put(coll: string, id: string, docJson: string): string
|
|
14
|
-
/** Full put with optional client / nonce
|
|
17
|
+
/** Full put with optional client / nonce — API compat, v2 ignores these. */
|
|
15
18
|
putEx(coll: string, id: string, docJson: string, client?: string | undefined | null, nonce?: bigint | undefined | null, idem?: string | undefined | null): string
|
|
16
19
|
delete(coll: string, id: string): void
|
|
17
20
|
deleteEx(coll: string, id: string, client?: string | undefined | null, nonce?: bigint | undefined | null, idem?: string | undefined | null): void
|
|
21
|
+
/** Link: stored as a doc in __links__ collection for NQL traversal. */
|
|
18
22
|
link(frm: string, rel: string, to: string): void
|
|
19
23
|
unlink(frm: string, rel: string, to: string): void
|
|
20
24
|
get(coll: string, id: string): string | null
|
|
21
|
-
/** Time-travel: return the document as it was at sequence `as_of`. */
|
|
22
25
|
getAsOf(coll: string, id: string, asOf: bigint): string | null
|
|
23
|
-
|
|
24
|
-
* Execute an NQL query string. Returns an array of JSON document strings.
|
|
25
|
-
* Full grammar supported: WHERE, ORDER BY, LIMIT, GROUP BY, TRAVERSE,
|
|
26
|
-
* SEARCH, AS OF, VALID AS OF, TRACE caused_by.
|
|
27
|
-
*/
|
|
28
|
-
query(nql: string): Array<string>
|
|
26
|
+
query(nqlStr: string): Array<string>
|
|
29
27
|
neighbors(frm: string, rel: string): Array<string>
|
|
30
28
|
neighborsAsOf(frm: string, rel: string, asOf: bigint): Array<string>
|
|
31
29
|
inbound(to: string, rel: string): Array<string>
|
|
@@ -33,5 +31,6 @@ export declare class NedbCore {
|
|
|
33
31
|
verify(): boolean
|
|
34
32
|
head(): string
|
|
35
33
|
seq(): bigint
|
|
34
|
+
/** Flush WAL and MANIFEST — v2 equivalent of v1 flush(). */
|
|
36
35
|
flush(): void
|
|
37
36
|
}
|
package/nedb.darwin-arm64.node
CHANGED
|
Binary file
|
package/nedb.darwin-x64.node
CHANGED
|
Binary file
|
package/nedb.linux-x64-gnu.node
CHANGED
|
Binary file
|
package/nedb.win32-x64-msvc.node
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nedb-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "NEDB — hash-chained, time-traveling, bi-temporal embedded database with Rust native core. SQL, Redis, MongoDB adapters. Causal Write Provenance. RESP2 wire protocol.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"license": "GPL-3.0-or-later",
|
|
15
|
-
"homepage": "https://github.com/
|
|
15
|
+
"homepage": "https://github.com/aiassistsecure/nedb#readme",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
18
|
+
"url": "git+https://github.com/aiassistsecure/nedb.git"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"database",
|