@lossless.org/nosqldb 10.10.0 → 10.11.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.
Files changed (39) hide show
  1. package/dist_rust/rustdb_linux_amd64 +0 -0
  2. package/dist_rust/rustdb_linux_amd64.tsrust-build.json +5 -5
  3. package/dist_rust/rustdb_linux_amd64_musl +0 -0
  4. package/dist_rust/rustdb_linux_amd64_musl.tsrust-build.json +5 -5
  5. package/dist_rust/rustdb_linux_arm64 +0 -0
  6. package/dist_rust/rustdb_linux_arm64.tsrust-build.json +5 -5
  7. package/dist_rust/rustdb_linux_arm64_musl +0 -0
  8. package/dist_rust/rustdb_linux_arm64_musl.tsrust-build.json +5 -5
  9. package/dist_rust/rustdb_macos_amd64 +0 -0
  10. package/dist_rust/rustdb_macos_amd64.tsrust-build.json +5 -5
  11. package/dist_rust/rustdb_macos_arm64 +0 -0
  12. package/dist_rust/rustdb_macos_arm64.tsrust-build.json +5 -5
  13. package/dist_ts/00_commitinfo_data.js +1 -1
  14. package/dist_ts_debugserver/bundled.js +2 -6
  15. package/package.json +5 -14
  16. package/readme.md +64 -1
  17. package/third_party_licenses/inventory.json +1 -1
  18. package/.smartconfig.json +0 -115
  19. package/ts/00_commitinfo_data.ts +0 -8
  20. package/ts/index.ts +0 -85
  21. package/ts/ts_local/classes.localnosqldb.ts +0 -608
  22. package/ts/ts_local/index.ts +0 -19
  23. package/ts/ts_local/plugins.ts +0 -1
  24. package/ts/ts_nosqldb/classes.storagerehearsal.ts +0 -109
  25. package/ts/ts_nosqldb/committed-writes.ts +0 -38
  26. package/ts/ts_nosqldb/file-storage-options.ts +0 -33
  27. package/ts/ts_nosqldb/file-storage-startup.ts +0 -10
  28. package/ts/ts_nosqldb/index.ts +0 -127
  29. package/ts/ts_nosqldb/offline-inspection.ts +0 -375
  30. package/ts/ts_nosqldb/plugins.ts +0 -12
  31. package/ts/ts_nosqldb/resource-fencing.ts +0 -368
  32. package/ts/ts_nosqldb/rust-db-bridge.ts +0 -1066
  33. package/ts/ts_nosqldb/server/classes.nosqldbserver.ts +0 -738
  34. package/ts/ts_nosqldb/server/index.ts +0 -4
  35. package/ts/ts_nosqldb/service-types.ts +0 -499
  36. package/ts/ts_nosqldb/stopped-storage.ts +0 -108
  37. package/ts/ts_nosqldb/storage-rehearsal.ts +0 -215
  38. package/ts/ts_nosqldb/storage-root-alignment.ts +0 -176
  39. package/ts/ts_nosqldb/storage-root-relocation.ts +0 -279
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lossless.org/nosqldb",
3
- "version": "10.10.0",
3
+ "version": "10.11.0",
4
4
  "private": false,
5
5
  "description": "A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.",
6
6
  "exports": {
@@ -15,12 +15,12 @@
15
15
  "@api.global/typedserver": "^8.4.6",
16
16
  "@design.estate/dees-element": "^2.2.4",
17
17
  "@git.zone/tsbuild": "^6.0.2",
18
- "@git.zone/tsbundle": "^3.2.1",
19
- "@git.zone/tsrust": "^4.1.0",
20
- "@git.zone/tstest": "^7.2.0",
18
+ "@git.zone/tsbundle": "^3.7.1",
19
+ "@git.zone/tsrust": "^5.0.0",
20
+ "@git.zone/tstest": "^8.0.0",
21
21
  "@lossless.org/client": "0.1.1",
22
22
  "@lossless.org/nosqldb-baseline-1081": "npm:@lossless.org/nosqldb@10.8.1",
23
- "@types/node": "26.6.4",
23
+ "@types/node": "26.6.5",
24
24
  "mongodb": "npm:@tempfix/mongodb@7.6.1"
25
25
  },
26
26
  "dependencies": {
@@ -31,16 +31,7 @@
31
31
  "last 1 chrome versions"
32
32
  ],
33
33
  "files": [
34
- "ts/**/*",
35
- "ts_migration/**/*",
36
- "ts_web/**/*",
37
- "dist/**/*",
38
34
  "dist_*/**/*",
39
- "dist_ts/**/*",
40
- "dist_ts_web/**/*",
41
- "assets/**/*",
42
- "cli.js",
43
- ".smartconfig.json",
44
35
  "readme.md",
45
36
  "third-party-notices.md",
46
37
  "license.md",
package/readme.md CHANGED
@@ -663,6 +663,69 @@ unique index key wins, and the later writer is told at its own statement.
663
663
  their statements and the second commit reports `WriteConflict` (112), as on
664
664
  MongoDB 7.
665
665
 
666
+ #### Read fences
667
+
668
+ `readFence` is a NoSQLDB command, not a MongoDB one, available from 10.11.0. It
669
+ lets a transaction depend on documents it read without writing them: its commit
670
+ fails if any of them changed after the transaction's snapshot. Two transactions
671
+ that only read and fence one document therefore both commit, where fencing by
672
+ writing the document would make one of them conflict.
673
+
674
+ ```typescript
675
+ await session.withTransaction(async () => {
676
+ const lane = await lanes.findOne({ _id: 'dns' }, { session });
677
+ await db.command({ readFence: 'lanes', ids: ['dns'] }, { session });
678
+ await jobs.insertOne({ _id: 'next', basedOn: lane?.revision }, { session });
679
+ });
680
+ ```
681
+
682
+ - `{ readFence: <collection>, ids: [...] }` answers `{ ok: 1 }`, only as a
683
+ statement of a multi-document transaction; outside one it is refused with
684
+ `InvalidOptions` (72). `ids` holds 1 to 1,000 `_id` values, otherwise the
685
+ statement fails with `BadValue` (2). Duplicates count once, compared as
686
+ `_id` values are, so `1`, `NumberLong(1)` and `1.0` are one id. It needs the
687
+ read privilege of the database, as `find` does, and refuses a view with
688
+ `CommandNotSupportedOnView` (166). A refused statement ends its transaction,
689
+ as every failed transaction statement does.
690
+ - `commitTransaction` is refused with `WriteConflict` (112), labelled
691
+ `TransientTransactionError` and never `UnknownTransactionCommitResult`, when
692
+ a fenced `_id` has a committed change newer than the transaction's snapshot:
693
+ an insert, replace, update, delete or TTL expiry, by any writer, inside or
694
+ outside a transaction. Fencing an absent `_id` holds its absence. A drop,
695
+ rename or re-create of the collection, a drop of its database, and the
696
+ creation of a fenced collection or database that was absent also refuse the
697
+ commit. The check is atomic with the commit, and nothing of a refused
698
+ transaction becomes visible; `withTransaction` retries it on a fresh
699
+ snapshot.
700
+ - A fence can also name documents by the value of a unique key, which holds
701
+ a value whether a document holds it or not:
702
+ `{ readFence: <collection>, key: <field>, values: [...] }`. On an existing
703
+ collection the field needs a unique, non-partial, single-field index with
704
+ the simple collation, otherwise the statement fails with `IndexNotFound`
705
+ (27). A null value, empty `values`, more than 1,000 values, or `ids` and
706
+ `key` together fail with `BadValue` (2); equal values count once.
707
+ `commitTransaction` is refused when, after the snapshot, a committed write
708
+ changed the document that held a fenced value, or made any document hold
709
+ one: an insert of an absent value, an update or replace of the holder, its
710
+ delete, a move of its key to another value, a delete and re-insert, another
711
+ document taking the value, or TTL expiry. Dropping the index also refuses
712
+ the commit. `key: "_id"` is the fence by `ids`.
713
+ - The statement itself never fails because of a concurrent change: only the
714
+ commit decides.
715
+ - A fence takes no write claim. Fences never conflict with each other, never
716
+ wait for a writer and never make one wait or fail. A writer that commits
717
+ after the fencer has committed succeeds: the order is fencer, then writer.
718
+ Changes to other documents of the collection, new indexes and new
719
+ collections do not refuse the fencer.
720
+ - Fencing and writing the same document makes the transaction a plain writer
721
+ of it. A transaction that only reads and fences still gets the commit check.
722
+ Transactions without fences behave exactly as before.
723
+ - The statement takes the database gate every transaction statement takes, so
724
+ `drop`, `renameCollection` and `dropDatabase` in that database wait for the
725
+ transaction to end, as they wait for any transaction with a statement there.
726
+ It retains no collection gate: creating the fenced collection or its indexes
727
+ does not wait for the transaction.
728
+
666
729
  Write intents live in memory only; no transaction survives a restart, so
667
730
  there is nothing to recover.
668
731
 
@@ -2193,7 +2256,7 @@ a 64-bit integer above that, as MongoDB does.
2193
2256
  | **Aggregation** | `aggregate`, `count`, `distinct` |
2194
2257
  | **Indexes** | `createIndexes`, `dropIndexes`, `listIndexes` |
2195
2258
  | **Sessions** | `startSession`, `endSessions`, `killSessions` |
2196
- | **Transactions** | `startTransaction`, `commitTransaction`, `abortTransaction` through driver sessions |
2259
+ | **Transactions** | `startTransaction`, `commitTransaction`, `abortTransaction` through driver sessions; `readFence` (NoSQLDB-specific, see Read fences) |
2197
2260
  | **Admin** | `ping`, `buildInfo`/`buildinfo`, `listDatabases`, `listCollections`, `drop`, `dropDatabase`, `create`, `collMod` (validation options), `serverStatus`, `dbStats`, `collStats`, `connectionStatus`, `renameCollection` |
2198
2261
 
2199
2262
  Advertises MongoDB wire protocol versions 0–21 and reports MongoDB 7.0.0
@@ -246,7 +246,7 @@
246
246
  "zmij@1.0.21"
247
247
  ],
248
248
  "files": {
249
- ".smartconfig.json": "a6b17fae7da13c9b5f6eef7049cfd13b497ab7e80739e17446becc0edd5ccefe",
249
+ ".smartconfig.json": "202775795f11034486c78ca5d7746a4524e522ea007da650cd66ceb37ed96334",
250
250
  "license.md": "cfa51b1d8428e453099273832dc2ec1cebdf23d7ba4eda307883158cfc77da2d",
251
251
  "rust-toolchain.toml": "8c3afbe90fa0feff766dffd92e6728a569c0a804cf49f1ecd47bf5ac262499b3",
252
252
  "rust/Cargo.lock": "543fc19bc27e5842b6c6326fbb66f9a52f0f0b7935d36181b8fb264a61df7d6f",
package/.smartconfig.json DELETED
@@ -1,115 +0,0 @@
1
- {
2
- "@git.zone/cli": {
3
- "projectType": "npm",
4
- "module": {
5
- "githost": "code.foss.global",
6
- "gitscope": "lossless.org",
7
- "gitrepo": "nosqldb",
8
- "description": "A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.",
9
- "npmPackagename": "@lossless.org/nosqldb",
10
- "license": "MIT",
11
- "projectDomain": "lossless.org",
12
- "keywords": [
13
- "mongodb-compatible",
14
- "wire protocol",
15
- "embedded database",
16
- "in-memory database",
17
- "testing",
18
- "local database",
19
- "database server",
20
- "rust"
21
- ]
22
- },
23
- "commit": {
24
- "push": {
25
- "remote": "lossless",
26
- "followTags": true
27
- }
28
- },
29
- "release": {
30
- "preflight": {
31
- "test": true,
32
- "testCommand": "pnpm run release:check-builders",
33
- "build": true,
34
- "buildCommand": "pnpm run release:build-artifacts"
35
- },
36
- "targets": {
37
- "git": {
38
- "enabled": true,
39
- "remote": "lossless",
40
- "pushBranch": true,
41
- "pushTags": true
42
- },
43
- "npm": {
44
- "enabled": true,
45
- "registries": [
46
- "https://verdaccio.lossless.digital",
47
- "https://registry.npmjs.org"
48
- ],
49
- "accessLevel": "public",
50
- "alreadyPublished": "success"
51
- }
52
- }
53
- },
54
- "services": [],
55
- "schemaVersion": 2
56
- },
57
- "@git.zone/tsdoc": {
58
- "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license.md) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
59
- },
60
- "@git.zone/tsbundle": {
61
- "bundles": [
62
- {
63
- "from": "./ts_debugui/index.ts",
64
- "to": "./ts_debugserver/bundled.ts",
65
- "outputMode": "base64ts",
66
- "bundler": "esbuild",
67
- "includeFiles": [
68
- {
69
- "from": "./html/index.html",
70
- "to": "index.html"
71
- }
72
- ]
73
- }
74
- ]
75
- },
76
- "@git.zone/tsrust": {
77
- "targetsByHost": {
78
- "linux": [
79
- "linux_amd64",
80
- "linux_arm64",
81
- "linux_amd64_musl",
82
- "linux_arm64_musl"
83
- ],
84
- "macos": [
85
- "macos_amd64",
86
- "macos_arm64"
87
- ]
88
- },
89
- "locked": true,
90
- "static": false,
91
- "matrix": {
92
- "builders": {
93
- "macos_arm64": {
94
- "transport": "ssh",
95
- "destinationEnv": "NOSQLDB_RELEASE_MACOS_SSH",
96
- "temporaryRootEnv": "NOSQLDB_RELEASE_MACOS_TEMP_ROOT"
97
- },
98
- "linux_amd64": {
99
- "transport": "local"
100
- }
101
- },
102
- "smokeTestArgs": [
103
- "--version"
104
- ],
105
- "verificationCommand": [
106
- "pnpm",
107
- "run",
108
- "release:verify-native"
109
- ]
110
- }
111
- },
112
- "@ship.zone/szci": {
113
- "npmGlobalTools": []
114
- }
115
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * autocreated commitinfo by @push.rocks/commitinfo
3
- */
4
- export const commitinfo = {
5
- name: '@lossless.org/nosqldb',
6
- version: '10.10.0',
7
- description: 'A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.'
8
- }
package/ts/index.ts DELETED
@@ -1,85 +0,0 @@
1
- import { commitinfo } from './00_commitinfo_data.js';
2
-
3
- // Export core NoSQLDB module
4
- export * from './ts_nosqldb/index.js';
5
-
6
- // Export LocalNoSqlDb
7
- export { LocalNoSqlDb } from './ts_local/index.js';
8
- export type {
9
- ILocalNoSqlDbOptions,
10
- ILocalNoSqlDbConnectionInfo,
11
- ILocalNoSqlDbOfflineInspectionLimits,
12
- ILocalNoSqlDbOfflinePhysicalNamespaceInspectionLimits,
13
- ILocalNoSqlDbOfflinePhysicalNamespaceInspection,
14
- ILocalNoSqlDbOfflinePhysicalNamespaceInspectionResult,
15
- ILocalNoSqlDbOfflineStringValueInspection,
16
- TLocalNoSqlDbOfflineStringValueInspectionResult,
17
- ILocalNoSqlDbStoppedStorageRootRelocationInput,
18
- ILocalNoSqlDbStoppedStorageRootRelocationReceipt,
19
- TLocalNoSqlDbStorageRootRelocationErrorCode,
20
- } from './ts_local/index.js';
21
- export {
22
- LocalNoSqlDbStorageRootRelocationError,
23
- localNoSqlDbStorageRootRelocationErrorCodes,
24
- } from './ts_local/index.js';
25
-
26
- // Export commitinfo
27
- export { commitinfo };
28
-
29
- // Re-export oplog / debug types for convenience
30
- export type {
31
- IOpLogEntry,
32
- IOpLogResult,
33
- IOpLogStats,
34
- IRevertResult,
35
- ICollectionInfo,
36
- IDocumentsResult,
37
- INoSqlDbMetrics,
38
- INoSqlDbHealth,
39
- INoSqlDbResourceFence,
40
- INoSqlDbResourceFenceReceipt,
41
- INoSqlDbHeldPublicationReceipt,
42
- INoSqlDbCommitDatabasePublicationInput,
43
- INoSqlDbManagementOperationOptions,
44
- INoSqlDbDatabaseResourceFenceState,
45
- INoSqlDbDatabaseAllocationIdentity,
46
- INoSqlDbDatabaseAllocationLifecycle,
47
- INoSqlDbDatabaseAllocationReadAccessGrantIdentity,
48
- INoSqlDbIssueDatabaseAllocationReadAccessGrantInput,
49
- INoSqlDbIssueDatabaseAllocationReadAccessGrantResult,
50
- INoSqlDbRevokeDatabaseAllocationReadAccessGrantInput,
51
- INoSqlDbRevokeDatabaseAllocationReadAccessGrantResult,
52
- TNoSqlDbCommitDatabasePublicationResult,
53
- TNoSqlDbResourceFenceErrorCode,
54
- TNoSqlDbAllocationReadAccessGrantErrorCode,
55
- INoSqlDbDatabaseTenantInput,
56
- INoSqlDbAttestDatabaseTenantInput,
57
- INoSqlDbAttestDatabaseTenantResult,
58
- INoSqlDbEnsureDatabaseTenantInput,
59
- INoSqlDbEnsureDatabaseTenantResult,
60
- INoSqlDbAllocateDatabaseTenantInput,
61
- INoSqlDbAllocateDatabaseTenantResult,
62
- INoSqlDbDeleteDatabaseTenantInput,
63
- INoSqlDbRotateDatabaseTenantPasswordInput,
64
- INoSqlDbDatabaseTenantDescriptor,
65
- INoSqlDbDeleteDatabaseTenantResult,
66
- INoSqlDbDatabaseExportCollection,
67
- INoSqlDbDatabaseExport,
68
- INoSqlDbDatabaseExportLimits,
69
- INoSqlDbExportDatabaseInput,
70
- INoSqlDbDatabaseContentDigestLimits,
71
- INoSqlDbGetDatabaseContentDigestInput,
72
- INoSqlDbDatabaseContentDigest,
73
- INoSqlDbImportDatabaseInput,
74
- INoSqlDbImportDatabaseResult,
75
- TNoSqlDbEffectivePayloadInputV1,
76
- } from './ts_nosqldb/index.js';
77
- export {
78
- NoSqlDbAllocationReadAccessGrantError,
79
- normalizeNoSqlDbAllocationReadAccessGrantError,
80
- noSqlDbAllocationReadAccessGrantErrorCodes,
81
- NoSqlDbResourceFenceError,
82
- normalizeNoSqlDbResourceFenceError,
83
- noSqlDbResourceFenceErrorCodes,
84
- createNoSqlDbEffectivePayloadSha256V1,
85
- } from './ts_nosqldb/index.js';