@based/db 0.0.56 → 0.0.57
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/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/libselva.so +0 -0
- package/dist/lib/linux_x86_64/libselva.so +0 -0
- package/dist/src/client/query/BasedDbQuery.js +8 -2
- package/dist/src/server/migrate/index.js +5 -1
- package/dist/src/shared/Emitter.d.ts +1 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -340,11 +340,17 @@ export class BasedDbQuery extends QueryBranch {
|
|
|
340
340
|
const res = await this.db.hooks.getQueryBuf(buf);
|
|
341
341
|
if (res.byteLength === 1) {
|
|
342
342
|
if (res[0] === 0) {
|
|
343
|
-
if (this.db.schema?.hash !== this.def.schemaChecksum) {
|
|
343
|
+
if (this.def && this.db.schema?.hash !== this.def.schemaChecksum) {
|
|
344
|
+
this.reset();
|
|
345
|
+
this.db.emit('info', 'query get schema mismatch - awaiting new schema');
|
|
346
|
+
await this.db.once('schema');
|
|
347
|
+
return this.#getInternal(resolve, reject);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
this.db.emit('info', 'query get schema mismatch - got the same already');
|
|
344
351
|
this.reset();
|
|
345
352
|
return this.#getInternal(resolve, reject);
|
|
346
353
|
}
|
|
347
|
-
reject(new Error('schema mismatch'));
|
|
348
354
|
}
|
|
349
355
|
else {
|
|
350
356
|
reject(new Error('unexpected error'));
|
|
@@ -31,7 +31,11 @@ const parseTransform = (transform) => {
|
|
|
31
31
|
export const migrate = async (server, fromSchema, toSchema, transform) => {
|
|
32
32
|
const migrationId = toSchema.hash;
|
|
33
33
|
server.migrating = migrationId;
|
|
34
|
-
|
|
34
|
+
server.emit('info', `migrating schema ${migrationId}`);
|
|
35
|
+
const abort = () => {
|
|
36
|
+
server.emit('info', `abort migration - migrating: ${server.migrating} abort: ${migrationId}`);
|
|
37
|
+
return server.migrating !== migrationId;
|
|
38
|
+
};
|
|
35
39
|
const tmpDb = new BasedDb({
|
|
36
40
|
path: null,
|
|
37
41
|
});
|