@powersync/service-module-mongodb-storage 0.13.2 → 0.15.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/CHANGELOG.md +51 -0
- package/dist/migrations/db/migrations/1770213298299-storage-version.d.ts +3 -0
- package/dist/migrations/db/migrations/1770213298299-storage-version.js +29 -0
- package/dist/migrations/db/migrations/1770213298299-storage-version.js.map +1 -0
- package/dist/storage/MongoBucketStorage.d.ts +7 -15
- package/dist/storage/MongoBucketStorage.js +28 -53
- package/dist/storage/MongoBucketStorage.js.map +1 -1
- package/dist/storage/implementation/MongoBucketBatch.d.ts +12 -11
- package/dist/storage/implementation/MongoBucketBatch.js +199 -127
- package/dist/storage/implementation/MongoBucketBatch.js.map +1 -1
- package/dist/storage/implementation/MongoChecksums.d.ts +8 -5
- package/dist/storage/implementation/MongoChecksums.js +8 -4
- package/dist/storage/implementation/MongoChecksums.js.map +1 -1
- package/dist/storage/implementation/MongoCompactor.d.ts +2 -2
- package/dist/storage/implementation/MongoCompactor.js +52 -26
- package/dist/storage/implementation/MongoCompactor.js.map +1 -1
- package/dist/storage/implementation/MongoParameterCompactor.d.ts +2 -2
- package/dist/storage/implementation/MongoParameterCompactor.js.map +1 -1
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.d.ts +2 -12
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.js +20 -25
- package/dist/storage/implementation/MongoPersistedSyncRulesContent.js.map +1 -1
- package/dist/storage/implementation/MongoSyncBucketStorage.d.ts +7 -4
- package/dist/storage/implementation/MongoSyncBucketStorage.js +11 -8
- package/dist/storage/implementation/MongoSyncBucketStorage.js.map +1 -1
- package/dist/storage/implementation/MongoSyncRulesLock.d.ts +3 -3
- package/dist/storage/implementation/MongoSyncRulesLock.js.map +1 -1
- package/dist/storage/implementation/MongoWriteCheckpointAPI.d.ts +4 -4
- package/dist/storage/implementation/MongoWriteCheckpointAPI.js.map +1 -1
- package/dist/storage/implementation/OperationBatch.js +3 -2
- package/dist/storage/implementation/OperationBatch.js.map +1 -1
- package/dist/storage/implementation/PersistedBatch.d.ts +11 -4
- package/dist/storage/implementation/PersistedBatch.js +42 -11
- package/dist/storage/implementation/PersistedBatch.js.map +1 -1
- package/dist/storage/implementation/db.d.ts +35 -1
- package/dist/storage/implementation/db.js +99 -0
- package/dist/storage/implementation/db.js.map +1 -1
- package/dist/storage/implementation/models.d.ts +25 -1
- package/dist/storage/implementation/models.js +10 -1
- package/dist/storage/implementation/models.js.map +1 -1
- package/dist/storage/storage-index.d.ts +0 -1
- package/dist/storage/storage-index.js +0 -1
- package/dist/storage/storage-index.js.map +1 -1
- package/dist/utils/test-utils.d.ts +7 -5
- package/dist/utils/test-utils.js +17 -14
- package/dist/utils/test-utils.js.map +1 -1
- package/dist/utils/util.d.ts +2 -1
- package/dist/utils/util.js +15 -1
- package/dist/utils/util.js.map +1 -1
- package/package.json +7 -7
- package/src/migrations/db/migrations/1770213298299-storage-version.ts +44 -0
- package/src/storage/MongoBucketStorage.ts +44 -61
- package/src/storage/implementation/MongoBucketBatch.ts +253 -177
- package/src/storage/implementation/MongoChecksums.ts +19 -9
- package/src/storage/implementation/MongoCompactor.ts +62 -31
- package/src/storage/implementation/MongoParameterCompactor.ts +3 -3
- package/src/storage/implementation/MongoPersistedSyncRulesContent.ts +20 -34
- package/src/storage/implementation/MongoSyncBucketStorage.ts +32 -17
- package/src/storage/implementation/MongoSyncRulesLock.ts +3 -3
- package/src/storage/implementation/MongoWriteCheckpointAPI.ts +4 -4
- package/src/storage/implementation/OperationBatch.ts +3 -2
- package/src/storage/implementation/PersistedBatch.ts +42 -11
- package/src/storage/implementation/db.ts +129 -1
- package/src/storage/implementation/models.ts +39 -1
- package/src/storage/storage-index.ts +0 -1
- package/src/utils/test-utils.ts +18 -16
- package/src/utils/util.ts +17 -2
- package/test/src/__snapshots__/storage.test.ts.snap +198 -22
- package/test/src/__snapshots__/storage_compacting.test.ts.snap +17 -0
- package/test/src/__snapshots__/storage_sync.test.ts.snap +2211 -21
- package/test/src/storage.test.ts +9 -7
- package/test/src/storage_compacting.test.ts +33 -24
- package/test/src/storage_sync.test.ts +31 -15
- package/test/src/util.ts +4 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/storage/implementation/MongoPersistedSyncRules.d.ts +0 -10
- package/dist/storage/implementation/MongoPersistedSyncRules.js +0 -17
- package/dist/storage/implementation/MongoPersistedSyncRules.js.map +0 -1
- package/src/storage/implementation/MongoPersistedSyncRules.ts +0 -20
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SyncConfigWithErrors, HydratedSyncRules } from '@powersync/service-sync-rules';
|
|
2
|
-
import { storage } from '@powersync/service-core';
|
|
3
|
-
export declare class MongoPersistedSyncRules implements storage.PersistedSyncRules {
|
|
4
|
-
readonly id: number;
|
|
5
|
-
readonly sync_rules: SyncConfigWithErrors;
|
|
6
|
-
readonly checkpoint_lsn: string | null;
|
|
7
|
-
readonly slot_name: string;
|
|
8
|
-
constructor(id: number, sync_rules: SyncConfigWithErrors, checkpoint_lsn: string | null, slot_name: string | null);
|
|
9
|
-
hydratedSyncRules(): HydratedSyncRules;
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { versionedHydrationState } from '@powersync/service-sync-rules';
|
|
2
|
-
export class MongoPersistedSyncRules {
|
|
3
|
-
id;
|
|
4
|
-
sync_rules;
|
|
5
|
-
checkpoint_lsn;
|
|
6
|
-
slot_name;
|
|
7
|
-
constructor(id, sync_rules, checkpoint_lsn, slot_name) {
|
|
8
|
-
this.id = id;
|
|
9
|
-
this.sync_rules = sync_rules;
|
|
10
|
-
this.checkpoint_lsn = checkpoint_lsn;
|
|
11
|
-
this.slot_name = slot_name ?? `powersync_${id}`;
|
|
12
|
-
}
|
|
13
|
-
hydratedSyncRules() {
|
|
14
|
-
return this.sync_rules.config.hydrate({ hydrationState: versionedHydrationState(this.id) });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=MongoPersistedSyncRules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongoPersistedSyncRules.js","sourceRoot":"","sources":["../../../src/storage/implementation/MongoPersistedSyncRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAIjH,MAAM,OAAO,uBAAuB;IAIhB;IACA;IACA;IALF,SAAS,CAAS;IAElC,YACkB,EAAU,EACV,UAAgC,EAChC,cAA6B,EAC7C,SAAwB;QAHR,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAsB;QAChC,mBAAc,GAAd,cAAc,CAAe;QAG7C,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,aAAa,EAAE,EAAE,CAAC;IAClD,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SyncConfigWithErrors, HydratedSyncRules, versionedHydrationState } from '@powersync/service-sync-rules';
|
|
2
|
-
|
|
3
|
-
import { storage } from '@powersync/service-core';
|
|
4
|
-
|
|
5
|
-
export class MongoPersistedSyncRules implements storage.PersistedSyncRules {
|
|
6
|
-
public readonly slot_name: string;
|
|
7
|
-
|
|
8
|
-
constructor(
|
|
9
|
-
public readonly id: number,
|
|
10
|
-
public readonly sync_rules: SyncConfigWithErrors,
|
|
11
|
-
public readonly checkpoint_lsn: string | null,
|
|
12
|
-
slot_name: string | null
|
|
13
|
-
) {
|
|
14
|
-
this.slot_name = slot_name ?? `powersync_${id}`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
hydratedSyncRules(): HydratedSyncRules {
|
|
18
|
-
return this.sync_rules.config.hydrate({ hydrationState: versionedHydrationState(this.id) });
|
|
19
|
-
}
|
|
20
|
-
}
|