@powersync/service-module-postgres-storage 0.13.3 → 0.14.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 +57 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/storage/PostgresBucketStorageFactory.d.ts +2 -1
- package/dist/@types/storage/PostgresReportStorage.d.ts +1 -1
- package/dist/@types/storage/PostgresSyncRulesStorage.d.ts +4 -2
- package/dist/@types/storage/batch/PostgresBucketBatch.d.ts +1 -1
- package/dist/@types/types/models/SyncRules.d.ts +9 -0
- package/dist/@types/types/models/models-index.d.ts +1 -1
- package/dist/@types/utils/test-utils.d.ts +2 -2
- package/dist/@types/utils/utils-index.d.ts +1 -1
- package/dist/migrations/migration-utils.js +2 -2
- package/dist/migrations/migration-utils.js.map +1 -1
- package/dist/migrations/scripts/1771424826685-current-data-pending-deletes.js +1 -1
- package/dist/storage/PostgresBucketStorageFactory.js +6 -5
- package/dist/storage/PostgresBucketStorageFactory.js.map +1 -1
- package/dist/storage/PostgresReportStorage.js +3 -3
- package/dist/storage/PostgresReportStorage.js.map +1 -1
- package/dist/storage/PostgresSyncRulesStorage.js +72 -39
- package/dist/storage/PostgresSyncRulesStorage.js.map +1 -1
- package/dist/storage/batch/PostgresBucketBatch.js +5 -5
- package/dist/storage/batch/PostgresBucketBatch.js.map +1 -1
- package/dist/storage/checkpoints/PostgresWriteCheckpointAPI.js +1 -1
- package/dist/storage/checkpoints/PostgresWriteCheckpointAPI.js.map +1 -1
- package/dist/storage/current-data-store.js +1 -1
- package/dist/storage/current-data-store.js.map +1 -1
- package/dist/storage/sync-rules/PostgresPersistedSyncRulesContent.js +3 -3
- package/dist/storage/sync-rules/PostgresPersistedSyncRulesContent.js.map +1 -1
- package/dist/types/models/SyncRules.js +3 -1
- package/dist/types/models/SyncRules.js.map +1 -1
- package/dist/types/models/models-index.js +1 -1
- package/dist/types/models/models-index.js.map +1 -1
- package/dist/utils/test-utils.js +3 -3
- package/dist/utils/test-utils.js.map +1 -1
- package/dist/utils/utils-index.js +1 -1
- package/dist/utils/utils-index.js.map +1 -1
- package/package.json +11 -11
- package/src/migrations/migration-utils.ts +2 -2
- package/src/migrations/scripts/1771424826685-current-data-pending-deletes.ts +1 -1
- package/src/storage/PostgresBucketStorageFactory.ts +7 -5
- package/src/storage/PostgresReportStorage.ts +5 -5
- package/src/storage/PostgresSyncRulesStorage.ts +81 -39
- package/src/storage/batch/PostgresBucketBatch.ts +5 -5
- package/src/storage/checkpoints/PostgresWriteCheckpointAPI.ts +3 -1
- package/src/storage/current-data-store.ts +1 -1
- package/src/storage/sync-rules/PostgresPersistedSyncRulesContent.ts +3 -6
- package/src/types/models/SyncRules.ts +3 -1
- package/src/types/models/models-index.ts +1 -1
- package/src/utils/test-utils.ts +3 -3
- package/src/utils/utils-index.ts +1 -1
- package/test/src/__snapshots__/storage_sync.test.ts.snap +282 -0
- package/test/src/connection-report-storage.test.ts +4 -4
- package/test/src/setup.ts +1 -1
- package/test/tsconfig.json +0 -1
- package/dist/@types/storage/current-data-table.d.ts +0 -9
- package/dist/storage/current-data-table.js +0 -22
- package/dist/storage/current-data-table.js.map +0 -1
- package/src/storage/current-data-table.ts +0 -26
package/test/src/setup.ts
CHANGED
package/test/tsconfig.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { storage } from '@powersync/service-core';
|
|
2
|
-
export declare const V1_CURRENT_DATA_TABLE = "current_data";
|
|
3
|
-
export declare const V3_CURRENT_DATA_TABLE = "v3_current_data";
|
|
4
|
-
/**
|
|
5
|
-
* The table used by a specific storage version for general current_data access.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getCommonCurrentDataTable(storageConfig: storage.StorageVersionConfig): "current_data" | "v3_current_data";
|
|
8
|
-
export declare function getV1CurrentDataTable(storageConfig: storage.StorageVersionConfig): string;
|
|
9
|
-
export declare function getV3CurrentDataTable(storageConfig: storage.StorageVersionConfig): string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ServiceAssertionError } from '@powersync/lib-services-framework';
|
|
2
|
-
export const V1_CURRENT_DATA_TABLE = 'current_data';
|
|
3
|
-
export const V3_CURRENT_DATA_TABLE = 'v3_current_data';
|
|
4
|
-
/**
|
|
5
|
-
* The table used by a specific storage version for general current_data access.
|
|
6
|
-
*/
|
|
7
|
-
export function getCommonCurrentDataTable(storageConfig) {
|
|
8
|
-
return storageConfig.softDeleteCurrentData ? V3_CURRENT_DATA_TABLE : V1_CURRENT_DATA_TABLE;
|
|
9
|
-
}
|
|
10
|
-
export function getV1CurrentDataTable(storageConfig) {
|
|
11
|
-
if (storageConfig.softDeleteCurrentData) {
|
|
12
|
-
throw new ServiceAssertionError('current_data table cannot be used when softDeleteCurrentData is enabled');
|
|
13
|
-
}
|
|
14
|
-
return V1_CURRENT_DATA_TABLE;
|
|
15
|
-
}
|
|
16
|
-
export function getV3CurrentDataTable(storageConfig) {
|
|
17
|
-
if (!storageConfig.softDeleteCurrentData) {
|
|
18
|
-
throw new ServiceAssertionError('v3_current_data table cannot be used when softDeleteCurrentData is disabled');
|
|
19
|
-
}
|
|
20
|
-
return V3_CURRENT_DATA_TABLE;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=current-data-table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"current-data-table.js","sourceRoot":"","sources":["../../src/storage/current-data-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAA2C;IACnF,OAAO,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,aAA2C;IAC/E,IAAI,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACxC,MAAM,IAAI,qBAAqB,CAAC,yEAAyE,CAAC,CAAC;IAC7G,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,aAA2C;IAC/E,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACzC,MAAM,IAAI,qBAAqB,CAAC,6EAA6E,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ServiceAssertionError } from '@powersync/lib-services-framework';
|
|
2
|
-
import { storage } from '@powersync/service-core';
|
|
3
|
-
|
|
4
|
-
export const V1_CURRENT_DATA_TABLE = 'current_data';
|
|
5
|
-
export const V3_CURRENT_DATA_TABLE = 'v3_current_data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The table used by a specific storage version for general current_data access.
|
|
9
|
-
*/
|
|
10
|
-
export function getCommonCurrentDataTable(storageConfig: storage.StorageVersionConfig) {
|
|
11
|
-
return storageConfig.softDeleteCurrentData ? V3_CURRENT_DATA_TABLE : V1_CURRENT_DATA_TABLE;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getV1CurrentDataTable(storageConfig: storage.StorageVersionConfig) {
|
|
15
|
-
if (storageConfig.softDeleteCurrentData) {
|
|
16
|
-
throw new ServiceAssertionError('current_data table cannot be used when softDeleteCurrentData is enabled');
|
|
17
|
-
}
|
|
18
|
-
return V1_CURRENT_DATA_TABLE;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function getV3CurrentDataTable(storageConfig: storage.StorageVersionConfig) {
|
|
22
|
-
if (!storageConfig.softDeleteCurrentData) {
|
|
23
|
-
throw new ServiceAssertionError('v3_current_data table cannot be used when softDeleteCurrentData is disabled');
|
|
24
|
-
}
|
|
25
|
-
return V3_CURRENT_DATA_TABLE;
|
|
26
|
-
}
|