@powersync/service-core 0.0.0-dev-20241022111143 → 0.0.0-dev-20241023230541
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 +5 -5
- package/dist/api/RouteAPI.d.ts +6 -4
- package/dist/api/diagnostics.js +3 -1
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/schema.js +2 -2
- package/dist/api/schema.js.map +1 -1
- package/dist/replication/AbstractReplicationJob.js +2 -2
- package/dist/replication/AbstractReplicationJob.js.map +1 -1
- package/dist/replication/ReplicationModule.d.ts +13 -1
- package/dist/replication/ReplicationModule.js +7 -4
- package/dist/replication/ReplicationModule.js.map +1 -1
- package/dist/routes/configure-fastify.js +12 -12
- package/dist/routes/configure-fastify.js.map +1 -1
- package/dist/routes/configure-rsocket.js +4 -1
- package/dist/routes/configure-rsocket.js.map +1 -1
- package/dist/routes/endpoints/admin.js.map +1 -1
- package/dist/routes/endpoints/sync-rules.js.map +1 -1
- package/dist/routes/router.d.ts +8 -1
- package/dist/routes/router.js.map +1 -1
- package/dist/storage/BucketStorage.d.ts +16 -11
- package/dist/storage/BucketStorage.js +6 -0
- package/dist/storage/BucketStorage.js.map +1 -1
- package/dist/storage/MongoBucketStorage.d.ts +1 -3
- package/dist/storage/MongoBucketStorage.js.map +1 -1
- package/dist/storage/mongo/MongoBucketBatch.js +1 -0
- package/dist/storage/mongo/MongoBucketBatch.js.map +1 -1
- package/dist/storage/mongo/MongoSyncBucketStorage.d.ts +2 -4
- package/dist/storage/mongo/MongoSyncBucketStorage.js +3 -2
- package/dist/storage/mongo/MongoSyncBucketStorage.js.map +1 -1
- package/dist/util/protocol-types.d.ts +2 -1
- package/package.json +5 -5
- package/src/api/RouteAPI.ts +7 -4
- package/src/api/diagnostics.ts +3 -1
- package/src/api/schema.ts +3 -3
- package/src/replication/AbstractReplicationJob.ts +2 -2
- package/src/replication/ReplicationModule.ts +26 -5
- package/src/routes/configure-fastify.ts +16 -17
- package/src/routes/configure-rsocket.ts +7 -2
- package/src/routes/endpoints/admin.ts +2 -2
- package/src/routes/endpoints/sync-rules.ts +1 -0
- package/src/routes/router.ts +7 -1
- package/src/storage/BucketStorage.ts +18 -10
- package/src/storage/MongoBucketStorage.ts +1 -3
- package/src/storage/mongo/MongoBucketBatch.ts +1 -0
- package/src/storage/mongo/MongoSyncBucketStorage.ts +5 -3
- package/src/util/protocol-types.ts +1 -1
- package/test/src/compacting.test.ts +13 -15
- package/test/src/data_storage.test.ts +56 -56
- package/test/src/sync.test.ts +10 -9
- package/tsconfig.tsbuildinfo +1 -1
package/test/src/sync.test.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SaveOperationTag } from '@/storage/storage-index.js';
|
|
1
2
|
import { RequestTracker } from '@/sync/RequestTracker.js';
|
|
2
3
|
import { streamResponse } from '@/sync/sync.js';
|
|
3
4
|
import { StreamingSyncLine } from '@/util/protocol-types.js';
|
|
@@ -36,7 +37,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
36
37
|
const result = await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
37
38
|
await batch.save({
|
|
38
39
|
sourceTable: TEST_TABLE,
|
|
39
|
-
tag:
|
|
40
|
+
tag: SaveOperationTag.INSERT,
|
|
40
41
|
after: {
|
|
41
42
|
id: 't1',
|
|
42
43
|
description: 'Test 1'
|
|
@@ -46,7 +47,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
46
47
|
|
|
47
48
|
await batch.save({
|
|
48
49
|
sourceTable: TEST_TABLE,
|
|
49
|
-
tag:
|
|
50
|
+
tag: SaveOperationTag.INSERT,
|
|
50
51
|
after: {
|
|
51
52
|
id: 't2',
|
|
52
53
|
description: 'Test 2'
|
|
@@ -87,7 +88,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
87
88
|
const result = await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
88
89
|
await batch.save({
|
|
89
90
|
sourceTable: TEST_TABLE,
|
|
90
|
-
tag:
|
|
91
|
+
tag: SaveOperationTag.INSERT,
|
|
91
92
|
after: {
|
|
92
93
|
id: 't1',
|
|
93
94
|
description: 'Test\n"string"',
|
|
@@ -174,7 +175,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
174
175
|
await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
175
176
|
await batch.save({
|
|
176
177
|
sourceTable: TEST_TABLE,
|
|
177
|
-
tag:
|
|
178
|
+
tag: SaveOperationTag.INSERT,
|
|
178
179
|
after: {
|
|
179
180
|
id: 't1',
|
|
180
181
|
description: 'Test 1'
|
|
@@ -190,7 +191,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
190
191
|
await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
191
192
|
await batch.save({
|
|
192
193
|
sourceTable: TEST_TABLE,
|
|
193
|
-
tag:
|
|
194
|
+
tag: SaveOperationTag.INSERT,
|
|
194
195
|
after: {
|
|
195
196
|
id: 't2',
|
|
196
197
|
description: 'Test 2'
|
|
@@ -257,7 +258,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
257
258
|
await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
258
259
|
await batch.save({
|
|
259
260
|
sourceTable: TEST_TABLE,
|
|
260
|
-
tag:
|
|
261
|
+
tag: SaveOperationTag.INSERT,
|
|
261
262
|
after: {
|
|
262
263
|
id: 't1',
|
|
263
264
|
description: 'Test 1'
|
|
@@ -267,7 +268,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
267
268
|
|
|
268
269
|
await batch.save({
|
|
269
270
|
sourceTable: TEST_TABLE,
|
|
270
|
-
tag:
|
|
271
|
+
tag: SaveOperationTag.INSERT,
|
|
271
272
|
after: {
|
|
272
273
|
id: 't2',
|
|
273
274
|
description: 'Test 2'
|
|
@@ -308,7 +309,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
308
309
|
await storage.startBatch(BATCH_OPTIONS, async (batch) => {
|
|
309
310
|
await batch.save({
|
|
310
311
|
sourceTable: TEST_TABLE,
|
|
311
|
-
tag:
|
|
312
|
+
tag: SaveOperationTag.UPDATE,
|
|
312
313
|
after: {
|
|
313
314
|
id: 't1',
|
|
314
315
|
description: 'Test 1b'
|
|
@@ -318,7 +319,7 @@ function defineTests(factory: StorageFactory) {
|
|
|
318
319
|
|
|
319
320
|
await batch.save({
|
|
320
321
|
sourceTable: TEST_TABLE,
|
|
321
|
-
tag:
|
|
322
|
+
tag: SaveOperationTag.UPDATE,
|
|
322
323
|
after: {
|
|
323
324
|
id: 't2',
|
|
324
325
|
description: 'Test 2b'
|