@agoric/swing-store 0.9.2-dev-4a1e4c3.0 → 0.9.2-dev-7ceb7f7.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/docs/swingstore.md +0 -2
- package/package.json +3 -3
- package/src/swingStore.js +4 -10
package/docs/swingstore.md
CHANGED
|
@@ -25,8 +25,6 @@ If, for some reason, the host wants to abandon execution, it can call `hostStora
|
|
|
25
25
|
|
|
26
26
|
`hostStorage.kvStore` is also available to let the host add items to a separate portion of the kvStore, using keys which start with a `host.` prefix. It can use this to coordinate with a separately-committed host database (e.g. to remember how much work has been given to the kernel, and how much has been successfully executed). This portion of the kvStore is unreachable by the kernel.
|
|
27
27
|
|
|
28
|
-
`hostStorage.setExportCallback()` is used to register an export callback after swingstore creation, see [data-export.md](./data-export.md) for details. Most applications will instead provide `options.exportCallback` to `openSwingStore()`.
|
|
29
|
-
|
|
30
28
|
`hostStorage.repairMetadata()` was used to repair a historical flaw in the database format, and is not needed by new installations.
|
|
31
29
|
|
|
32
30
|
## KernelStorage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/swing-store",
|
|
3
|
-
"version": "0.9.2-dev-
|
|
3
|
+
"version": "0.9.2-dev-7ceb7f7.0+7ceb7f7",
|
|
4
4
|
"description": "Persistent storage for SwingSet",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint:eslint": "eslint ."
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agoric/internal": "0.3.3-dev-
|
|
24
|
+
"@agoric/internal": "0.3.3-dev-7ceb7f7.0+7ceb7f7",
|
|
25
25
|
"@endo/base64": "^1.0.7",
|
|
26
26
|
"@endo/bundle-source": "^3.4.0",
|
|
27
27
|
"@endo/check-bundle": "^1.0.9",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"typeCoverage": {
|
|
52
52
|
"atLeast": 79.02
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "7ceb7f7f2b618179098442fc103f636f989474b6"
|
|
55
55
|
}
|
package/src/swingStore.js
CHANGED
|
@@ -48,7 +48,6 @@ import { doRepairMetadata } from './repairMetadata.js';
|
|
|
48
48
|
* commit: () => Promise<void>, // commit changes made since the last commit
|
|
49
49
|
* close: () => Promise<void>, // shutdown the store, abandoning any uncommitted changes
|
|
50
50
|
* diskUsage?: () => number, // optional stats method
|
|
51
|
-
* setExportCallback: (cb: (updates: KVPair[]) => void) => void, // Set a callback invoked by swingStore when new serializable data is available for export
|
|
52
51
|
* repairMetadata: (exporter: import('./exporter.js').SwingStoreExporter) => Promise<void>,
|
|
53
52
|
* }} SwingStoreHostStorage
|
|
54
53
|
*/
|
|
@@ -274,14 +273,10 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
|
|
|
274
273
|
)
|
|
275
274
|
`);
|
|
276
275
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
typeof
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
if (options.exportCallback) {
|
|
283
|
-
setExportCallback(options.exportCallback);
|
|
284
|
-
}
|
|
276
|
+
const { exportCallback } = options;
|
|
277
|
+
exportCallback === undefined ||
|
|
278
|
+
typeof exportCallback === 'function' ||
|
|
279
|
+
Fail`export callback must be a function`;
|
|
285
280
|
|
|
286
281
|
const sqlAddPendingExport = db.prepare(`
|
|
287
282
|
INSERT INTO pendingExports (key, value)
|
|
@@ -600,7 +595,6 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
|
|
|
600
595
|
commit,
|
|
601
596
|
close,
|
|
602
597
|
diskUsage,
|
|
603
|
-
setExportCallback,
|
|
604
598
|
};
|
|
605
599
|
const debug = {
|
|
606
600
|
serialize,
|