@based/db 0.0.50 → 0.0.51
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/lib/darwin_aarch64/libdeflate.dylib +0 -0
- package/dist/lib/darwin_aarch64/libjemalloc_selva.2.dylib +0 -0
- package/dist/lib/darwin_aarch64/libnode-v20.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v21.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v22.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v23.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v24.node +0 -0
- package/dist/lib/darwin_aarch64/libselva.dylib +0 -0
- package/dist/lib/linux_aarch64/libnode-v20.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v21.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v22.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v23.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v24.node +0 -0
- package/dist/lib/linux_aarch64/libselva.so +0 -0
- package/dist/lib/linux_x86_64/libnode-v20.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v21.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v22.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v23.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v24.node +0 -0
- package/dist/lib/linux_x86_64/libselva.so +0 -0
- package/dist/src/hooks.js +7 -2
- package/dist/src/schema.js +4 -2
- package/dist/src/server/index.js +7 -1
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/src/hooks.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import picocolors from 'picocolors';
|
|
2
|
+
import { displayTarget } from './client/query/display.js';
|
|
1
3
|
export const getDefaultHooks = (server, subInterval = 200) => {
|
|
2
4
|
return {
|
|
3
5
|
subscribe(q, onData, onError) {
|
|
@@ -8,7 +10,7 @@ export const getDefaultHooks = (server, subInterval = 200) => {
|
|
|
8
10
|
if (killed) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
|
-
if (res.byteLength >=
|
|
13
|
+
if (res.byteLength >= 4) {
|
|
12
14
|
onData(res);
|
|
13
15
|
}
|
|
14
16
|
else if (res.byteLength === 1 && res[0] === 0) {
|
|
@@ -17,7 +19,10 @@ export const getDefaultHooks = (server, subInterval = 200) => {
|
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
19
21
|
else {
|
|
20
|
-
|
|
22
|
+
const def = this.def;
|
|
23
|
+
let name = picocolors.red(`QueryError[${displayTarget(def)}]\n`);
|
|
24
|
+
name += ` Incorrect buffer received in subscription (maybe server not started ${res.byteLength}) bytes\n`;
|
|
25
|
+
onError(new Error(name));
|
|
21
26
|
}
|
|
22
27
|
timer = setTimeout(poll, subInterval);
|
|
23
28
|
};
|
package/dist/src/schema.js
CHANGED
|
@@ -55,14 +55,15 @@ export const parseSchema = (strictSchema) => {
|
|
|
55
55
|
};
|
|
56
56
|
const props = { ...strictSchema.props };
|
|
57
57
|
for (const key in props) {
|
|
58
|
-
const prop = props[key];
|
|
58
|
+
const prop = { ...props[key] };
|
|
59
59
|
const propType = getPropType(prop);
|
|
60
60
|
let refProp;
|
|
61
61
|
if (propType === 'reference') {
|
|
62
62
|
refProp = prop;
|
|
63
63
|
}
|
|
64
64
|
else if (propType === 'references') {
|
|
65
|
-
refProp = prop.items;
|
|
65
|
+
refProp = { ...prop.items };
|
|
66
|
+
prop.items = refProp;
|
|
66
67
|
}
|
|
67
68
|
if (refProp) {
|
|
68
69
|
const type = parsedSchema.types[refProp.ref];
|
|
@@ -81,6 +82,7 @@ export const parseSchema = (strictSchema) => {
|
|
|
81
82
|
};
|
|
82
83
|
refProp.prop = inverseKey;
|
|
83
84
|
}
|
|
85
|
+
props[key] = prop;
|
|
84
86
|
}
|
|
85
87
|
// @ts-ignore This creates an internal type to use for root props
|
|
86
88
|
parsedSchema.types._root = {
|
package/dist/src/server/index.js
CHANGED
|
@@ -287,7 +287,13 @@ export class DbServer {
|
|
|
287
287
|
if (schemaLooseEqual(parsedSchema, this.schema)) {
|
|
288
288
|
return this.schema;
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
try {
|
|
291
|
+
return this.migrateSchema(strictSchema, transformFns);
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
console.error('error migrating schema:', e);
|
|
295
|
+
return this.schema;
|
|
296
|
+
}
|
|
291
297
|
}
|
|
292
298
|
this.schema = {
|
|
293
299
|
lastId: this.schema.lastId,
|