@powersync/service-module-postgres-storage 0.18.0 → 0.19.1
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/scripts/1788000000000-sync-config-version-label.d.ts +3 -0
- package/dist/migrations/scripts/1788000000000-sync-config-version-label.js +12 -0
- package/dist/migrations/scripts/1788000000000-sync-config-version-label.js.map +1 -0
- package/dist/storage/PostgresBucketStorageFactory.d.ts +1 -0
- package/dist/storage/PostgresBucketStorageFactory.js +14 -7
- package/dist/storage/PostgresBucketStorageFactory.js.map +1 -1
- package/dist/storage/PostgresStorageProvider.js +2 -1
- package/dist/storage/PostgresStorageProvider.js.map +1 -1
- package/dist/storage/PostgresSyncRulesStorage.d.ts +4 -3
- package/dist/storage/PostgresSyncRulesStorage.js +17 -5
- package/dist/storage/PostgresSyncRulesStorage.js.map +1 -1
- package/dist/storage/batch/PostgresBucketBatch.d.ts +2 -2
- package/dist/storage/batch/PostgresBucketBatch.js +8 -5
- package/dist/storage/batch/PostgresBucketBatch.js.map +1 -1
- package/dist/storage/checkpoints/PostgresWriteCheckpointAPI.d.ts +1 -1
- package/dist/storage/checkpoints/PostgresWriteCheckpointAPI.js +2 -2
- package/dist/storage/checkpoints/PostgresWriteCheckpointAPI.js.map +1 -1
- package/dist/storage/sync-rules/PostgresPersistedSyncConfigContent.js +5 -1
- package/dist/storage/sync-rules/PostgresPersistedSyncConfigContent.js.map +1 -1
- package/dist/types/models/ActiveCheckpoint.d.ts +2 -2
- package/dist/types/models/ActiveCheckpoint.js +3 -2
- package/dist/types/models/ActiveCheckpoint.js.map +1 -1
- package/dist/types/models/ActiveCheckpointNotification.d.ts +2 -2
- package/dist/types/models/BucketData.d.ts +6 -6
- package/dist/types/models/BucketData.js +7 -6
- package/dist/types/models/BucketData.js.map +1 -1
- package/dist/types/models/CurrentData.d.ts +1 -1
- package/dist/types/models/CurrentData.js +2 -1
- package/dist/types/models/CurrentData.js.map +1 -1
- package/dist/types/models/SdkReporting.d.ts +3 -3
- package/dist/types/models/SdkReporting.js +3 -5
- package/dist/types/models/SdkReporting.js.map +1 -1
- package/dist/types/models/SourceTable.d.ts +7 -7
- package/dist/types/models/SourceTable.js +7 -6
- package/dist/types/models/SourceTable.js.map +1 -1
- package/dist/types/models/SyncRules.d.ts +11 -10
- package/dist/types/models/SyncRules.js +12 -11
- package/dist/types/models/SyncRules.js.map +1 -1
- package/dist/types/models/WriteCheckpoint.d.ts +2 -2
- package/dist/types/models/WriteCheckpoint.js +3 -2
- package/dist/types/models/WriteCheckpoint.js.map +1 -1
- package/dist/types/types.d.ts +2 -0
- package/package.json +8 -8
- package/src/migrations/scripts/1788000000000-sync-config-version-label.ts +18 -0
- package/src/storage/PostgresBucketStorageFactory.ts +15 -7
- package/src/storage/PostgresStorageProvider.ts +2 -1
- package/src/storage/PostgresSyncRulesStorage.ts +21 -6
- package/src/storage/batch/PostgresBucketBatch.ts +9 -6
- package/src/storage/checkpoints/PostgresWriteCheckpointAPI.ts +2 -2
- package/src/storage/sync-rules/PostgresPersistedSyncConfigContent.ts +8 -1
- package/src/types/models/ActiveCheckpoint.ts +3 -2
- package/src/types/models/BucketData.ts +7 -6
- package/src/types/models/CurrentData.ts +2 -1
- package/src/types/models/SdkReporting.ts +4 -4
- package/src/types/models/SourceTable.ts +7 -6
- package/src/types/models/SyncRules.ts +12 -11
- package/src/types/models/WriteCheckpoint.ts +3 -2
- package/test/src/__snapshots__/storage_sync.test.ts.snap +0 -995
- package/test/src/checkpoint_notifications.test.ts +8 -2
- package/test/src/storage.test.ts +12 -4
- package/test/src/storage_compacting.test.ts +2 -2
- package/test/src/util.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -11,8 +11,8 @@ export class PostgresWriteCheckpointAPI {
|
|
|
11
11
|
get writeCheckpointMode() {
|
|
12
12
|
return this._mode;
|
|
13
13
|
}
|
|
14
|
-
setWriteCheckpointMode(
|
|
15
|
-
this._mode = mode;
|
|
14
|
+
setWriteCheckpointMode(config) {
|
|
15
|
+
this._mode = config.mode;
|
|
16
16
|
}
|
|
17
17
|
async batchCreateCustomWriteCheckpoints(checkpoints, op_id) {
|
|
18
18
|
return batchCreateCustomWriteCheckpoints(this.db, checkpoints);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresWriteCheckpointAPI.js","sourceRoot":"","sources":["../../../src/storage/checkpoints/PostgresWriteCheckpointAPI.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAO9C,MAAM,OAAO,0BAA0B;IAC5B,EAAE,CAA8B;IACjC,KAAK,CAA8B;IAE3C,YAAY,OAAqC;QAC/C,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"PostgresWriteCheckpointAPI.js","sourceRoot":"","sources":["../../../src/storage/checkpoints/PostgresWriteCheckpointAPI.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAO9C,MAAM,OAAO,0BAA0B;IAC5B,EAAE,CAA8B;IACjC,KAAK,CAA8B;IAE3C,YAAY,OAAqC;QAC/C,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5B,CAA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IAAI,EAAE,CAAC;YAChB,oDAAoD;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,GAAG,CAAA;;;;;;oBAMb,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;8BACzB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;KACxD;aACE,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;aAC/B,KAAK,EAAE,CAAC;QACX,OAAO,GAAG,EAAE,gBAAgB,IAAI,IAAI,CAAC;IACvC,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,EAA+B,EAC/B,WAAmD;IAEnD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,iDAAiD;IACjD,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC/C,OAAO;YACL,OAAO,EAAE,EAAE,CAAC,OAAO;YACnB,sDAAsD;YACtD,2EAA2E;YAC3E,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC;YACjC,aAAa,EAAE,EAAE,CAAC,aAAa;YAC/B,uBAAuB,EAAE,EAAE,CAAC,uBAAuB,EAAE,WAAW,EAAE,IAAI,IAAI;SAC3E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,EAAE,CAAC,GAAG,CAAA;;;;iCAImB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BzE,CAAC,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -11,7 +11,8 @@ export class PostgresPersistedSyncConfigContent extends storage.PersistedSyncCon
|
|
|
11
11
|
compiled_plan: row.sync_plan,
|
|
12
12
|
replicationStreamName: row.slot_name,
|
|
13
13
|
storageVersion: row.storage_version ?? storage.LEGACY_STORAGE_VERSION,
|
|
14
|
-
syncConfigState: row.state
|
|
14
|
+
syncConfigState: row.state,
|
|
15
|
+
version_label: row.version_label ?? undefined
|
|
15
16
|
});
|
|
16
17
|
this.db = db;
|
|
17
18
|
}
|
|
@@ -55,6 +56,9 @@ export class PostgresPersistedReplicationStream extends storage.PersistedReplica
|
|
|
55
56
|
});
|
|
56
57
|
this.db = db;
|
|
57
58
|
this.row = row;
|
|
59
|
+
if (this.storageVersion >= storage.STORAGE_VERSION_4) {
|
|
60
|
+
throw new ServiceError(ErrorCode.PSYNC_S1005, `Unsupported storage version ${this.storageVersion} for PostgreSQL storage`);
|
|
61
|
+
}
|
|
58
62
|
this.syncConfigContent = [new PostgresPersistedSyncConfigContent(this.db, this.row)];
|
|
59
63
|
}
|
|
60
64
|
parsed(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresPersistedSyncConfigContent.js","sourceRoot":"","sources":["../../../src/storage/sync-rules/PostgresPersistedSyncConfigContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,OAAO,kCAAmC,SAAQ,OAAO,CAAC,0BAA0B;IAE9E;IADV,YACU,EAA+B,EACvC,GAA4B;QAE5B,KAAK,CAAC;YACJ,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,kBAAkB,EAAE,GAAG,CAAC,OAAO;YAC/B,aAAa,EAAE,GAAG,CAAC,SAAS;YAC5B,qBAAqB,EAAE,GAAG,CAAC,SAAS;YACpC,cAAc,EAAE,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC,sBAAsB;YACrE,eAAe,EAAE,GAAG,CAAC,KAA8B;
|
|
1
|
+
{"version":3,"file":"PostgresPersistedSyncConfigContent.js","sourceRoot":"","sources":["../../../src/storage/sync-rules/PostgresPersistedSyncConfigContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,OAAO,kCAAmC,SAAQ,OAAO,CAAC,0BAA0B;IAE9E;IADV,YACU,EAA+B,EACvC,GAA4B;QAE5B,KAAK,CAAC;YACJ,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,kBAAkB,EAAE,GAAG,CAAC,OAAO;YAC/B,aAAa,EAAE,GAAG,CAAC,SAAS;YAC5B,qBAAqB,EAAE,GAAG,CAAC,SAAS;YACpC,cAAc,EAAE,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC,sBAAsB;YACrE,eAAe,EAAE,GAAG,CAAC,KAA8B;YACnD,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,SAAS;SAC9C,CAAC,CAAC;QAXK,OAAE,GAAF,EAAE,CAA6B;IAYzC,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,GAAG,CAAA;;;;;;eAMlB,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE;KAC3D;aACE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;aACzB,KAAK,EAAE,CAAC;QAEX,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACF;AAED,SAAS,uBAAu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|
5
5
|
*/
|
|
6
6
|
export declare const ActiveCheckpoint: t.ObjectCodec<{
|
|
7
7
|
id: t.Codec<number, number, "pg_number", t.CodecProps>;
|
|
8
|
-
last_checkpoint: t.
|
|
9
|
-
last_checkpoint_lsn: t.
|
|
8
|
+
last_checkpoint: t.Codec<bigint | null, string | number | null>;
|
|
9
|
+
last_checkpoint_lsn: t.Codec<string | null, string | null>;
|
|
10
10
|
}>;
|
|
11
11
|
export type ActiveCheckpoint = t.Encoded<typeof ActiveCheckpoint>;
|
|
12
12
|
export type ActiveCheckpointDecoded = t.Decoded<typeof ActiveCheckpoint>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { orNull } from '@powersync/service-types';
|
|
1
2
|
import * as t from 'ts-codec';
|
|
2
3
|
import { bigint, pgwire_number } from '../codecs.js';
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import { bigint, pgwire_number } from '../codecs.js';
|
|
|
6
7
|
*/
|
|
7
8
|
export const ActiveCheckpoint = t.object({
|
|
8
9
|
id: pgwire_number,
|
|
9
|
-
last_checkpoint:
|
|
10
|
-
last_checkpoint_lsn:
|
|
10
|
+
last_checkpoint: orNull(bigint),
|
|
11
|
+
last_checkpoint_lsn: orNull(t.string)
|
|
11
12
|
});
|
|
12
13
|
//# sourceMappingURL=ActiveCheckpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveCheckpoint.js","sourceRoot":"","sources":["../../../src/types/models/ActiveCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,aAAa;IACjB,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ActiveCheckpoint.js","sourceRoot":"","sources":["../../../src/types/models/ActiveCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,aAAa;IACjB,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;CACtC,CAAC,CAAC"}
|
|
@@ -2,8 +2,8 @@ import * as t from 'ts-codec';
|
|
|
2
2
|
export declare const ActiveCheckpointPayload: t.ObjectCodec<{
|
|
3
3
|
active_checkpoint: t.ObjectCodec<{
|
|
4
4
|
id: t.Codec<number, number, "pg_number", t.CodecProps>;
|
|
5
|
-
last_checkpoint: t.
|
|
6
|
-
last_checkpoint_lsn: t.
|
|
5
|
+
last_checkpoint: t.Codec<bigint | null, string | number | null>;
|
|
6
|
+
last_checkpoint_lsn: t.Codec<string | null, string | null>;
|
|
7
7
|
}>;
|
|
8
8
|
}>;
|
|
9
9
|
export type ActiveCheckpointPayload = t.Encoded<typeof ActiveCheckpointPayload>;
|
|
@@ -10,13 +10,13 @@ export declare const BucketData: t.ObjectCodec<{
|
|
|
10
10
|
bucket_name: t.IdentityCodec<t.CodecType.String>;
|
|
11
11
|
op_id: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
12
12
|
op: t.EnumCodec<typeof OpType>;
|
|
13
|
-
source_table: t.
|
|
14
|
-
source_key: t.
|
|
15
|
-
table_name: t.
|
|
16
|
-
row_id: t.
|
|
13
|
+
source_table: t.Codec<string | null, string | null>;
|
|
14
|
+
source_key: t.Codec<Buffer<ArrayBuffer> | null, string | null>;
|
|
15
|
+
table_name: t.Codec<string | null, string | null>;
|
|
16
|
+
row_id: t.Codec<string | null, string | null>;
|
|
17
17
|
checksum: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
18
|
-
data: t.
|
|
19
|
-
target_op: t.
|
|
18
|
+
data: t.Codec<string | null, string | null>;
|
|
19
|
+
target_op: t.Codec<bigint | null, string | number | null>;
|
|
20
20
|
}>;
|
|
21
21
|
export type BucketData = t.Encoded<typeof BucketData>;
|
|
22
22
|
export type BucketDataDecoded = t.Decoded<typeof BucketData>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { orNull } from '@powersync/service-types';
|
|
1
2
|
import * as t from 'ts-codec';
|
|
2
3
|
import { bigint, hexBuffer, pgwire_number } from '../codecs.js';
|
|
3
4
|
export var OpType;
|
|
@@ -12,12 +13,12 @@ export const BucketData = t.object({
|
|
|
12
13
|
bucket_name: t.string,
|
|
13
14
|
op_id: bigint,
|
|
14
15
|
op: t.Enum(OpType),
|
|
15
|
-
source_table:
|
|
16
|
-
source_key:
|
|
17
|
-
table_name: t.string
|
|
18
|
-
row_id: t.string
|
|
16
|
+
source_table: orNull(t.string),
|
|
17
|
+
source_key: orNull(hexBuffer),
|
|
18
|
+
table_name: orNull(t.string),
|
|
19
|
+
row_id: orNull(t.string),
|
|
19
20
|
checksum: bigint,
|
|
20
|
-
data:
|
|
21
|
-
target_op:
|
|
21
|
+
data: orNull(t.string),
|
|
22
|
+
target_op: orNull(bigint)
|
|
22
23
|
});
|
|
23
24
|
//# sourceMappingURL=BucketData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BucketData.js","sourceRoot":"","sources":["../../../src/types/models/BucketData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,qBAAW,CAAA;IACX,2BAAiB,CAAA;IACjB,uBAAa,CA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AC,CAAC"}
|
|
@@ -29,7 +29,7 @@ export declare const V3CurrentData: t.ObjectCodec<{
|
|
|
29
29
|
lookups: t.ArrayCodec<t.Codec<Buffer<ArrayBuffer>, string, "hexBuffer", t.CodecProps>>;
|
|
30
30
|
source_key: t.Codec<Buffer<ArrayBuffer>, string, "hexBuffer", t.CodecProps>;
|
|
31
31
|
source_table: t.IdentityCodec<t.CodecType.String>;
|
|
32
|
-
pending_delete: t.
|
|
32
|
+
pending_delete: t.Codec<bigint | null, string | number | null>;
|
|
33
33
|
}>;
|
|
34
34
|
export type V1CurrentData = t.Encoded<typeof V1CurrentData>;
|
|
35
35
|
export type V1CurrentDataDecoded = t.Decoded<typeof V1CurrentData>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { orNull } from '@powersync/service-types';
|
|
1
2
|
import * as t from 'ts-codec';
|
|
2
3
|
import { bigint, hexBuffer, jsonb, pgwire_number } from '../codecs.js';
|
|
3
4
|
export const CurrentBucket = t.object({
|
|
@@ -20,6 +21,6 @@ export const V3CurrentData = t.object({
|
|
|
20
21
|
lookups: t.array(hexBuffer),
|
|
21
22
|
source_key: hexBuffer,
|
|
22
23
|
source_table: t.string,
|
|
23
|
-
pending_delete:
|
|
24
|
+
pending_delete: orNull(bigint)
|
|
24
25
|
});
|
|
25
26
|
//# sourceMappingURL=CurrentData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentData.js","sourceRoot":"","sources":["../../../src/types/models/CurrentData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM;IACf,EAAE,EAAE,CAAC,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,CAAC;IACtC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACtC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC;CAC/B,CAAC,CAAC"}
|
|
@@ -7,15 +7,15 @@ export declare const Sdks: t.ObjectCodec<{
|
|
|
7
7
|
export type Sdks = t.Encoded<typeof Sdks>;
|
|
8
8
|
export declare const SdkReporting: t.ObjectCodec<{
|
|
9
9
|
users: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
10
|
-
sdks: t.
|
|
10
|
+
sdks: t.OptionalCodec<t.Codec<{
|
|
11
11
|
data: {
|
|
12
12
|
sdk: string;
|
|
13
13
|
clients: number;
|
|
14
14
|
users: number;
|
|
15
15
|
}[];
|
|
16
|
-
} |
|
|
16
|
+
} | null, {
|
|
17
17
|
data: string;
|
|
18
|
-
} |
|
|
18
|
+
} | null, string, t.CodecProps>>;
|
|
19
19
|
}>;
|
|
20
20
|
export type SdkReporting = t.Encoded<typeof SdkReporting>;
|
|
21
21
|
export type SdkReportingDecoded = t.Decoded<typeof SdkReporting>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { orNull } from '@powersync/service-types';
|
|
1
2
|
import * as t from 'ts-codec';
|
|
2
3
|
import { bigint, jsonb } from '../codecs.js';
|
|
3
4
|
export const Sdks = t.object({
|
|
@@ -7,11 +8,8 @@ export const Sdks = t.object({
|
|
|
7
8
|
});
|
|
8
9
|
export const SdkReporting = t.object({
|
|
9
10
|
users: bigint,
|
|
10
|
-
sdks: t
|
|
11
|
-
.object({
|
|
11
|
+
sdks: orNull(t.object({
|
|
12
12
|
data: jsonb(t.array(Sdks))
|
|
13
|
-
})
|
|
14
|
-
.optional()
|
|
15
|
-
.or(t.Null)
|
|
13
|
+
})).optional()
|
|
16
14
|
});
|
|
17
15
|
//# sourceMappingURL=SdkReporting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkReporting.js","sourceRoot":"","sources":["../../../src/types/models/SdkReporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM;IACb,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM;CAChB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"SdkReporting.js","sourceRoot":"","sources":["../../../src/types/models/SdkReporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM;IACb,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM;CAChB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,MAAM,CACV,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,KAAK,CAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACnC,CAAC,CACH,CAAC,QAAQ,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -18,22 +18,22 @@ export declare const SourceTable: t.ObjectCodec<{
|
|
|
18
18
|
id: t.IdentityCodec<t.CodecType.String>;
|
|
19
19
|
group_id: t.Codec<number, number, "pg_number", t.CodecProps>;
|
|
20
20
|
connection_id: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
21
|
-
relation_id: t.
|
|
21
|
+
relation_id: t.Codec<StoredRelationId | null, string | null>;
|
|
22
22
|
schema_name: t.IdentityCodec<t.CodecType.String>;
|
|
23
23
|
table_name: t.IdentityCodec<t.CodecType.String>;
|
|
24
|
-
replica_id_columns: t.
|
|
24
|
+
replica_id_columns: t.Codec<{
|
|
25
25
|
name: string;
|
|
26
26
|
type?: string | undefined;
|
|
27
27
|
type_oid?: number | undefined;
|
|
28
|
-
}[]
|
|
28
|
+
}[] | null, string | null>;
|
|
29
29
|
snapshot_done: t.IdentityCodec<t.CodecType.Boolean>;
|
|
30
|
-
snapshot_total_estimated_count: t.
|
|
31
|
-
snapshot_replicated_count: t.
|
|
32
|
-
snapshot_last_key: t.
|
|
30
|
+
snapshot_total_estimated_count: t.Codec<bigint | null, string | number | null>;
|
|
31
|
+
snapshot_replicated_count: t.Codec<bigint | null, string | number | null>;
|
|
32
|
+
snapshot_last_key: t.Codec<Buffer<ArrayBuffer> | null, string | null>;
|
|
33
33
|
/**
|
|
34
34
|
* Source-specific metadata. Null for legacy records.
|
|
35
35
|
*/
|
|
36
|
-
source_metadata: t.
|
|
36
|
+
source_metadata: t.Codec<JsonValue, string | null>;
|
|
37
37
|
}>;
|
|
38
38
|
export type SourceTable = t.Encoded<typeof SourceTable>;
|
|
39
39
|
export type SourceTableDecoded = t.Decoded<typeof SourceTable>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { orNull } from '@powersync/service-types';
|
|
1
2
|
import * as t from 'ts-codec';
|
|
2
3
|
import { bigint, hexBuffer, jsonb, jsonb_raw, pgwire_number } from '../codecs.js';
|
|
3
4
|
export const ColumnDescriptor = t.object({
|
|
@@ -15,17 +16,17 @@ export const SourceTable = t.object({
|
|
|
15
16
|
id: t.string,
|
|
16
17
|
group_id: pgwire_number,
|
|
17
18
|
connection_id: bigint,
|
|
18
|
-
relation_id:
|
|
19
|
+
relation_id: orNull(jsonb_raw()),
|
|
19
20
|
schema_name: t.string,
|
|
20
21
|
table_name: t.string,
|
|
21
|
-
replica_id_columns:
|
|
22
|
+
replica_id_columns: orNull(jsonb(t.array(ColumnDescriptor))),
|
|
22
23
|
snapshot_done: t.boolean,
|
|
23
|
-
snapshot_total_estimated_count:
|
|
24
|
-
snapshot_replicated_count:
|
|
25
|
-
snapshot_last_key:
|
|
24
|
+
snapshot_total_estimated_count: orNull(bigint),
|
|
25
|
+
snapshot_replicated_count: orNull(bigint),
|
|
26
|
+
snapshot_last_key: orNull(hexBuffer),
|
|
26
27
|
/**
|
|
27
28
|
* Source-specific metadata. Null for legacy records.
|
|
28
29
|
*/
|
|
29
|
-
source_metadata:
|
|
30
|
+
source_metadata: orNull(jsonb_raw())
|
|
30
31
|
});
|
|
31
32
|
//# sourceMappingURL=SourceTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceTable.js","sourceRoot":"","sources":["../../../src/types/models/SourceTable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC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AE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5D,aAAa,EAAE,CAAC,CAAC,OAAO;IACxB,8BAA8B,EAAE,MAAM,CAAC,MAAM,CAAC;IAC9C,yBAAyB,EAAE,MAAM,CAAC,MAAM,CAAC;IACzC,iBAAiB,EAAE,MAAM,CAAC,SAAS,CAAC;IACpC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC,SAAS,EAAa,CAAC;CAChD,CAAC,CAAC"}
|
|
@@ -12,42 +12,43 @@ export declare const SyncRules: t.ObjectCodec<{
|
|
|
12
12
|
/**
|
|
13
13
|
* May be set if snapshot_done = false, if the replication stream requires it.
|
|
14
14
|
*/
|
|
15
|
-
snapshot_lsn: t.
|
|
15
|
+
snapshot_lsn: t.Codec<string | null, string | null>;
|
|
16
16
|
/**
|
|
17
17
|
* The last consistent checkpoint.
|
|
18
18
|
*
|
|
19
19
|
* There may be higher OpIds used in the database if we're in the middle of replicating a large transaction.
|
|
20
20
|
*/
|
|
21
|
-
last_checkpoint: t.
|
|
21
|
+
last_checkpoint: t.Codec<bigint | null, string | number | null>;
|
|
22
22
|
/**
|
|
23
23
|
* The LSN associated with the last consistent checkpoint.
|
|
24
24
|
*/
|
|
25
|
-
last_checkpoint_lsn: t.
|
|
25
|
+
last_checkpoint_lsn: t.Codec<string | null, string | null>;
|
|
26
26
|
/**
|
|
27
27
|
* If set, no new checkpoints may be created < this value.
|
|
28
28
|
*/
|
|
29
|
-
no_checkpoint_before: t.
|
|
29
|
+
no_checkpoint_before: t.Codec<string | null, string | null>;
|
|
30
30
|
slot_name: t.IdentityCodec<t.CodecType.String>;
|
|
31
31
|
/**
|
|
32
32
|
* Last time we persisted a checkpoint.
|
|
33
33
|
*
|
|
34
34
|
* This may be old if no data is incoming.
|
|
35
35
|
*/
|
|
36
|
-
last_checkpoint_ts: t.
|
|
36
|
+
last_checkpoint_ts: t.Codec<Date | null, string | import("@powersync/service-sync-rules").DateTimeValue | null>;
|
|
37
37
|
/**
|
|
38
38
|
* Last time we persisted a checkpoint or keepalive.
|
|
39
39
|
*
|
|
40
40
|
* This should stay fairly current while replicating.
|
|
41
41
|
*/
|
|
42
|
-
last_keepalive_ts: t.
|
|
42
|
+
last_keepalive_ts: t.Codec<Date | null, string | import("@powersync/service-sync-rules").DateTimeValue | null>;
|
|
43
43
|
/**
|
|
44
44
|
* If an error is stopping replication, it will be stored here.
|
|
45
45
|
*/
|
|
46
|
-
last_fatal_error: t.
|
|
47
|
-
keepalive_op: t.
|
|
46
|
+
last_fatal_error: t.Codec<string | null, string | null>;
|
|
47
|
+
keepalive_op: t.Codec<bigint | null, string | number | null>;
|
|
48
48
|
storage_version: t.OptionalCodec<t.Codec<number | null, number | null, string, t.CodecProps>>;
|
|
49
|
+
version_label: t.OptionalCodec<t.Codec<string | null, string | null, string, t.CodecProps>>;
|
|
49
50
|
content: t.IdentityCodec<t.CodecType.String>;
|
|
50
|
-
sync_plan: t.
|
|
51
|
+
sync_plan: t.Codec<{
|
|
51
52
|
plan: any;
|
|
52
53
|
compatibility: {
|
|
53
54
|
edition: number;
|
|
@@ -64,7 +65,7 @@ export declare const SyncRules: t.ObjectCodec<{
|
|
|
64
65
|
} | undefined;
|
|
65
66
|
ts?: string | undefined;
|
|
66
67
|
}[] | undefined;
|
|
67
|
-
}, import("@powersync/service-jsonbig").JsonContainer
|
|
68
|
+
} | null, import("@powersync/service-jsonbig").JsonContainer | null>;
|
|
68
69
|
}>;
|
|
69
70
|
export type SyncRules = t.Encoded<typeof SyncRules>;
|
|
70
71
|
export type SyncRulesDecoded = t.Decoded<typeof SyncRules>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { framework, storage } from '@powersync/service-core';
|
|
2
|
-
import { ReplicationError } from '@powersync/service-types';
|
|
2
|
+
import { orNull, ReplicationError } from '@powersync/service-types';
|
|
3
3
|
import * as t from 'ts-codec';
|
|
4
4
|
import { bigint, pgwire_number } from '../codecs.js';
|
|
5
5
|
import { jsonContainerObject } from './json.js';
|
|
@@ -15,42 +15,43 @@ export const SyncRules = t.object({
|
|
|
15
15
|
/**
|
|
16
16
|
* May be set if snapshot_done = false, if the replication stream requires it.
|
|
17
17
|
*/
|
|
18
|
-
snapshot_lsn:
|
|
18
|
+
snapshot_lsn: orNull(t.string),
|
|
19
19
|
/**
|
|
20
20
|
* The last consistent checkpoint.
|
|
21
21
|
*
|
|
22
22
|
* There may be higher OpIds used in the database if we're in the middle of replicating a large transaction.
|
|
23
23
|
*/
|
|
24
|
-
last_checkpoint:
|
|
24
|
+
last_checkpoint: orNull(bigint),
|
|
25
25
|
/**
|
|
26
26
|
* The LSN associated with the last consistent checkpoint.
|
|
27
27
|
*/
|
|
28
|
-
last_checkpoint_lsn:
|
|
28
|
+
last_checkpoint_lsn: orNull(t.string),
|
|
29
29
|
/**
|
|
30
30
|
* If set, no new checkpoints may be created < this value.
|
|
31
31
|
*/
|
|
32
|
-
no_checkpoint_before:
|
|
32
|
+
no_checkpoint_before: orNull(t.string),
|
|
33
33
|
slot_name: t.string,
|
|
34
34
|
/**
|
|
35
35
|
* Last time we persisted a checkpoint.
|
|
36
36
|
*
|
|
37
37
|
* This may be old if no data is incoming.
|
|
38
38
|
*/
|
|
39
|
-
last_checkpoint_ts:
|
|
39
|
+
last_checkpoint_ts: orNull(framework.codecs.date),
|
|
40
40
|
/**
|
|
41
41
|
* Last time we persisted a checkpoint or keepalive.
|
|
42
42
|
*
|
|
43
43
|
* This should stay fairly current while replicating.
|
|
44
44
|
*/
|
|
45
|
-
last_keepalive_ts:
|
|
45
|
+
last_keepalive_ts: orNull(framework.codecs.date),
|
|
46
46
|
/**
|
|
47
47
|
* If an error is stopping replication, it will be stored here.
|
|
48
48
|
*/
|
|
49
|
-
last_fatal_error:
|
|
50
|
-
keepalive_op:
|
|
51
|
-
storage_version:
|
|
49
|
+
last_fatal_error: orNull(t.string),
|
|
50
|
+
keepalive_op: orNull(bigint),
|
|
51
|
+
storage_version: orNull(pgwire_number).optional(),
|
|
52
|
+
version_label: orNull(t.string).optional(),
|
|
52
53
|
content: t.string,
|
|
53
|
-
sync_plan:
|
|
54
|
+
sync_plan: orNull(jsonContainerObject(t.object({
|
|
54
55
|
plan: t.any,
|
|
55
56
|
compatibility: t.object({
|
|
56
57
|
edition: t.number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncRules.js","sourceRoot":"","sources":["../../../src/types/models/SyncRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"SyncRules.js","sourceRoot":"","sources":["../../../src/types/models/SyncRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IACpC;;;;OAIG;IACH,aAAa,EAAE,CAAC,CAAC,OAAO;IACxB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9B;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACrC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM;IACnB;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;IACjD;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;IAChD;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IACjD,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,SAAS,EAAE,MAAM,CACf,mBAAmB,CACjB,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,GAAG;QACX,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,CAAC,CAAC,MAAM;YACjB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9B,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC3C,CAAC;QACF,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;KAC7C,CAAC,CACH,CACF;CACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ export declare const WriteCheckpoint: t.ObjectCodec<{
|
|
|
3
3
|
user_id: t.IdentityCodec<t.CodecType.String>;
|
|
4
4
|
lsns: t.Codec<Record<string, string>, string, string, t.CodecProps>;
|
|
5
5
|
write_checkpoint: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
6
|
-
checkpoint_requested_at: t.
|
|
6
|
+
checkpoint_requested_at: t.Codec<Date | null, string | import("@powersync/service-sync-rules").DateTimeValue | null>;
|
|
7
7
|
}>;
|
|
8
8
|
export type WriteCheckpoint = t.Encoded<typeof WriteCheckpoint>;
|
|
9
9
|
export type WriteCheckpointDecoded = t.Decoded<typeof WriteCheckpoint>;
|
|
@@ -11,7 +11,7 @@ export declare const CustomWriteCheckpoint: t.ObjectCodec<{
|
|
|
11
11
|
user_id: t.IdentityCodec<t.CodecType.String>;
|
|
12
12
|
write_checkpoint: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
13
13
|
sync_rules_id: t.Codec<bigint, string | number, string, t.CodecProps>;
|
|
14
|
-
checkpoint_requested_at: t.
|
|
14
|
+
checkpoint_requested_at: t.Codec<Date | null, string | import("@powersync/service-sync-rules").DateTimeValue | null>;
|
|
15
15
|
}>;
|
|
16
16
|
export type CustomWriteCheckpoint = t.Encoded<typeof CustomWriteCheckpoint>;
|
|
17
17
|
export type CustomWriteCheckpointDecoded = t.Decoded<typeof CustomWriteCheckpoint>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { framework } from '@powersync/service-core';
|
|
2
|
+
import { orNull } from '@powersync/service-types';
|
|
2
3
|
import * as t from 'ts-codec';
|
|
3
4
|
import { bigint, jsonb } from '../codecs.js';
|
|
4
5
|
export const WriteCheckpoint = t.object({
|
|
5
6
|
user_id: t.string,
|
|
6
7
|
lsns: jsonb(t.record(t.string)),
|
|
7
8
|
write_checkpoint: bigint,
|
|
8
|
-
checkpoint_requested_at:
|
|
9
|
+
checkpoint_requested_at: orNull(framework.codecs.date)
|
|
9
10
|
});
|
|
10
11
|
export const CustomWriteCheckpoint = t.object({
|
|
11
12
|
user_id: t.string,
|
|
12
13
|
write_checkpoint: bigint,
|
|
13
14
|
sync_rules_id: bigint,
|
|
14
|
-
checkpoint_requested_at:
|
|
15
|
+
checkpoint_requested_at: orNull(framework.codecs.date)
|
|
15
16
|
});
|
|
16
17
|
//# sourceMappingURL=WriteCheckpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteCheckpoint.js","sourceRoot":"","sources":["../../../src/types/models/WriteCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/B,gBAAgB,EAAE,MAAM;IACxB,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"WriteCheckpoint.js","sourceRoot":"","sources":["../../../src/types/models/WriteCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/B,gBAAgB,EAAE,MAAM;IACxB,uBAAuB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;CACvD,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,gBAAgB,EAAE,MAAM;IACxB,aAAa,EAAE,MAAM;IACrB,uBAAuB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;CACvD,CAAC,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export type OperationBatchLimits = t.Encoded<typeof OperationBatchLimits>;
|
|
|
32
32
|
export declare const PostgresStorageConfig: t.Intersection<t.Codec<{
|
|
33
33
|
type: string;
|
|
34
34
|
max_pool_size?: number | undefined;
|
|
35
|
+
default_storage_version?: number | undefined;
|
|
35
36
|
} & {
|
|
36
37
|
type: "postgresql";
|
|
37
38
|
id?: string | undefined;
|
|
@@ -54,6 +55,7 @@ export declare const PostgresStorageConfig: t.Intersection<t.Codec<{
|
|
|
54
55
|
}, {
|
|
55
56
|
type: string;
|
|
56
57
|
max_pool_size?: number | undefined;
|
|
58
|
+
default_storage_version?: number | undefined;
|
|
57
59
|
} & {
|
|
58
60
|
type: "postgresql";
|
|
59
61
|
id?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/service-module-postgres-storage",
|
|
3
3
|
"repository": "https://github.com/powersync-ja/powersync-service",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.1",
|
|
5
5
|
"license": "FSL-1.1-ALv2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"lru-cache": "^10.2.2",
|
|
17
17
|
"ts-codec": "^1.3.0",
|
|
18
18
|
"uuid": "^14.0.0",
|
|
19
|
-
"@powersync/lib-service-postgres": "0.5.
|
|
20
|
-
"@powersync/lib-services-framework": "0.10.
|
|
21
|
-
"@powersync/service-core": "1.
|
|
22
|
-
"@powersync/service-types": "0.
|
|
23
|
-
"@powersync/service-jpgwire": "0.21.
|
|
19
|
+
"@powersync/lib-service-postgres": "0.5.5",
|
|
20
|
+
"@powersync/lib-services-framework": "0.10.2",
|
|
21
|
+
"@powersync/service-core": "1.26.1",
|
|
22
|
+
"@powersync/service-types": "0.18.0",
|
|
23
|
+
"@powersync/service-jpgwire": "0.21.24",
|
|
24
24
|
"@powersync/service-jsonbig": "0.17.13",
|
|
25
|
-
"@powersync/service-sync-rules": "0.
|
|
25
|
+
"@powersync/service-sync-rules": "0.42.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "~6.0.3",
|
|
29
|
-
"@powersync/service-core-tests": "0.18.
|
|
29
|
+
"@powersync/service-core-tests": "0.18.2"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsc -b",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { migrations } from '@powersync/service-core';
|
|
2
|
+
import { openMigrationDB } from '../migration-utils.js';
|
|
3
|
+
|
|
4
|
+
export const up: migrations.PowerSyncMigrationFunction = async (context) => {
|
|
5
|
+
const {
|
|
6
|
+
service_context: { configuration }
|
|
7
|
+
} = context;
|
|
8
|
+
await using client = openMigrationDB(configuration.storage);
|
|
9
|
+
await client.sql`ALTER TABLE sync_rules ADD COLUMN version_label TEXT`.execute();
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const down: migrations.PowerSyncMigrationFunction = async (context) => {
|
|
13
|
+
const {
|
|
14
|
+
service_context: { configuration }
|
|
15
|
+
} = context;
|
|
16
|
+
await using client = openMigrationDB(configuration.storage);
|
|
17
|
+
await client.sql`ALTER TABLE sync_rules DROP COLUMN version_label`.execute();
|
|
18
|
+
};
|