@livestore/livestore 0.5.0-dev.1 → 0.5.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.
Files changed (36) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/QueryCache.d.ts.map +1 -1
  3. package/dist/QueryCache.js +1 -2
  4. package/dist/QueryCache.js.map +1 -1
  5. package/dist/ReactiveStateSqliteDb.d.ts +9 -0
  6. package/dist/ReactiveStateSqliteDb.d.ts.map +1 -0
  7. package/dist/ReactiveStateSqliteDb.js +6 -0
  8. package/dist/ReactiveStateSqliteDb.js.map +1 -0
  9. package/dist/SqliteDbWrapper.d.ts +11 -9
  10. package/dist/SqliteDbWrapper.d.ts.map +1 -1
  11. package/dist/SqliteDbWrapper.js +65 -14
  12. package/dist/SqliteDbWrapper.js.map +1 -1
  13. package/dist/SqliteDbWrapper.test.js +18 -0
  14. package/dist/SqliteDbWrapper.test.js.map +1 -1
  15. package/dist/live-queries/db-query.test.js +4 -0
  16. package/dist/live-queries/db-query.test.js.map +1 -1
  17. package/dist/store/create-store.d.ts.map +1 -1
  18. package/dist/store/create-store.js +47 -17
  19. package/dist/store/create-store.js.map +1 -1
  20. package/dist/store/store-types.d.ts +2 -2
  21. package/dist/store/store-types.d.ts.map +1 -1
  22. package/dist/store/store-types.js.map +1 -1
  23. package/dist/store/store.d.ts +2 -2
  24. package/dist/store/store.d.ts.map +1 -1
  25. package/dist/store/store.js +32 -34
  26. package/dist/store/store.js.map +1 -1
  27. package/package.json +12 -12
  28. package/src/QueryCache.ts +1 -3
  29. package/src/ReactiveStateSqliteDb.ts +10 -0
  30. package/src/SqliteDbWrapper.test.ts +21 -0
  31. package/src/SqliteDbWrapper.ts +81 -19
  32. package/src/live-queries/__snapshots__/db-query.test.ts.snap +223 -278
  33. package/src/live-queries/db-query.test.ts +4 -0
  34. package/src/store/create-store.ts +68 -22
  35. package/src/store/store-types.ts +11 -2
  36. package/src/store/store.ts +101 -102
@@ -8,9 +8,6 @@ exports[`otel > QueryBuilder subscription - async iterator 1`] = `
8
8
  "storeId": "default",
9
9
  },
10
10
  "children": [
11
- {
12
- "_name": "makeClientSessionSyncProcessor",
13
- },
14
11
  {
15
12
  "_name": "livestore.in-memory-db:execute",
16
13
  "attributes": {
@@ -23,25 +20,30 @@ exports[`otel > QueryBuilder subscription - async iterator 1`] = `
23
20
  ",
24
21
  },
25
22
  },
23
+ {
24
+ "_name": "makeClientSessionSyncProcessor",
25
+ },
26
26
  {
27
27
  "_name": "client-session-sync-processor:boot",
28
28
  "children": [
29
29
  {
30
- "_name": "client-session-sync-processor:pull",
30
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
31
31
  "attributes": {
32
- "effect.fiber.interrupted": true,
32
+ "batch": "undefined",
33
+ "batchSize": 1,
33
34
  },
34
35
  },
35
36
  {
36
- "_name": "@livestore/common:LeaderSyncProcessor:push",
37
+ "_name": "client-session-sync-processor:pull",
37
38
  "attributes": {
38
- "batch": "undefined",
39
- "batchSize": 1,
40
39
  "effect.fiber.interrupted": true,
41
40
  },
42
41
  },
43
42
  ],
44
43
  },
44
+ {
45
+ "_name": "client-session-sync-processor:shutdown",
46
+ },
45
47
  {
46
48
  "_name": "LiveStore:commits",
47
49
  },
@@ -110,13 +112,20 @@ exports[`otel > QueryBuilder subscription - async iterator 2`] = `
110
112
  },
111
113
  "children": [
112
114
  {
113
- "_name": "client-session-sync-processor:encode-events",
114
- },
115
- {
116
- "_name": "client-session-sync-processor:materialize-events",
115
+ "_name": "client-session-sync-processor:commit",
116
+ "attributes": {
117
+ "batchSize": 1,
118
+ "eventCounts": "{
119
+ "todo.created": 1
120
+ }",
121
+ "mergeResultTag": "advance",
122
+ },
117
123
  "children": [
118
124
  {
119
- "_name": "client-session-sync-processor:materialize-event",
125
+ "_name": "client-session-sync-processor:encode-events",
126
+ },
127
+ {
128
+ "_name": "client-session-sync-processor:materialize-events",
120
129
  "children": [
121
130
  {
122
131
  "_name": "livestore.in-memory-db:execute",
@@ -127,12 +136,7 @@ exports[`otel > QueryBuilder subscription - async iterator 2`] = `
127
136
  {
128
137
  "_name": "@livestore/common:execSql",
129
138
  "attributes": {
130
- "bindValueKeys": [
131
- "$id",
132
- "$seqNumGlobal",
133
- "$seqNumClient",
134
- "$seqNumRebaseGeneration",
135
- ],
139
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
136
140
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
137
141
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
138
142
  },
@@ -141,16 +145,6 @@ exports[`otel > QueryBuilder subscription - async iterator 2`] = `
141
145
  },
142
146
  ],
143
147
  },
144
- {
145
- "_name": "client-session-sync-processor:push",
146
- "attributes": {
147
- "batchSize": 1,
148
- "eventCounts": "{
149
- "todo.created": 1
150
- }",
151
- "mergeResultTag": "advance",
152
- },
153
- },
154
148
  ],
155
149
  },
156
150
  ]
@@ -164,9 +158,6 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 1
164
158
  "storeId": "default",
165
159
  },
166
160
  "children": [
167
- {
168
- "_name": "makeClientSessionSyncProcessor",
169
- },
170
161
  {
171
162
  "_name": "livestore.in-memory-db:execute",
172
163
  "attributes": {
@@ -179,25 +170,30 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 1
179
170
  ",
180
171
  },
181
172
  },
173
+ {
174
+ "_name": "makeClientSessionSyncProcessor",
175
+ },
182
176
  {
183
177
  "_name": "client-session-sync-processor:boot",
184
178
  "children": [
185
179
  {
186
- "_name": "client-session-sync-processor:pull",
180
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
187
181
  "attributes": {
188
- "effect.fiber.interrupted": true,
182
+ "batch": "undefined",
183
+ "batchSize": 1,
189
184
  },
190
185
  },
191
186
  {
192
- "_name": "@livestore/common:LeaderSyncProcessor:push",
187
+ "_name": "client-session-sync-processor:pull",
193
188
  "attributes": {
194
- "batch": "undefined",
195
- "batchSize": 1,
196
189
  "effect.fiber.interrupted": true,
197
190
  },
198
191
  },
199
192
  ],
200
193
  },
194
+ {
195
+ "_name": "client-session-sync-processor:shutdown",
196
+ },
201
197
  {
202
198
  "_name": "LiveStore:commits",
203
199
  },
@@ -266,13 +262,20 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 2
266
262
  },
267
263
  "children": [
268
264
  {
269
- "_name": "client-session-sync-processor:encode-events",
270
- },
271
- {
272
- "_name": "client-session-sync-processor:materialize-events",
265
+ "_name": "client-session-sync-processor:commit",
266
+ "attributes": {
267
+ "batchSize": 1,
268
+ "eventCounts": "{
269
+ "todo.created": 1
270
+ }",
271
+ "mergeResultTag": "advance",
272
+ },
273
273
  "children": [
274
274
  {
275
- "_name": "client-session-sync-processor:materialize-event",
275
+ "_name": "client-session-sync-processor:encode-events",
276
+ },
277
+ {
278
+ "_name": "client-session-sync-processor:materialize-events",
276
279
  "children": [
277
280
  {
278
281
  "_name": "livestore.in-memory-db:execute",
@@ -283,12 +286,7 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 2
283
286
  {
284
287
  "_name": "@livestore/common:execSql",
285
288
  "attributes": {
286
- "bindValueKeys": [
287
- "$id",
288
- "$seqNumGlobal",
289
- "$seqNumClient",
290
- "$seqNumRebaseGeneration",
291
- ],
289
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
292
290
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
293
291
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
294
292
  },
@@ -297,16 +295,6 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 2
297
295
  },
298
296
  ],
299
297
  },
300
- {
301
- "_name": "client-session-sync-processor:push",
302
- "attributes": {
303
- "batchSize": 1,
304
- "eventCounts": "{
305
- "todo.created": 1
306
- }",
307
- "mergeResultTag": "advance",
308
- },
309
- },
310
298
  ],
311
299
  },
312
300
  ]
@@ -320,9 +308,6 @@ exports[`otel > QueryBuilder subscription - basic functionality 1`] = `
320
308
  "storeId": "default",
321
309
  },
322
310
  "children": [
323
- {
324
- "_name": "makeClientSessionSyncProcessor",
325
- },
326
311
  {
327
312
  "_name": "livestore.in-memory-db:execute",
328
313
  "attributes": {
@@ -335,25 +320,30 @@ exports[`otel > QueryBuilder subscription - basic functionality 1`] = `
335
320
  ",
336
321
  },
337
322
  },
323
+ {
324
+ "_name": "makeClientSessionSyncProcessor",
325
+ },
338
326
  {
339
327
  "_name": "client-session-sync-processor:boot",
340
328
  "children": [
341
329
  {
342
- "_name": "client-session-sync-processor:pull",
330
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
343
331
  "attributes": {
344
- "effect.fiber.interrupted": true,
332
+ "batch": "undefined",
333
+ "batchSize": 1,
345
334
  },
346
335
  },
347
336
  {
348
- "_name": "@livestore/common:LeaderSyncProcessor:push",
337
+ "_name": "client-session-sync-processor:pull",
349
338
  "attributes": {
350
- "batch": "undefined",
351
- "batchSize": 1,
352
339
  "effect.fiber.interrupted": true,
353
340
  },
354
341
  },
355
342
  ],
356
343
  },
344
+ {
345
+ "_name": "client-session-sync-processor:shutdown",
346
+ },
357
347
  {
358
348
  "_name": "LiveStore:commits",
359
349
  },
@@ -422,13 +412,20 @@ exports[`otel > QueryBuilder subscription - basic functionality 2`] = `
422
412
  },
423
413
  "children": [
424
414
  {
425
- "_name": "client-session-sync-processor:encode-events",
426
- },
427
- {
428
- "_name": "client-session-sync-processor:materialize-events",
415
+ "_name": "client-session-sync-processor:commit",
416
+ "attributes": {
417
+ "batchSize": 1,
418
+ "eventCounts": "{
419
+ "todo.created": 1
420
+ }",
421
+ "mergeResultTag": "advance",
422
+ },
429
423
  "children": [
430
424
  {
431
- "_name": "client-session-sync-processor:materialize-event",
425
+ "_name": "client-session-sync-processor:encode-events",
426
+ },
427
+ {
428
+ "_name": "client-session-sync-processor:materialize-events",
432
429
  "children": [
433
430
  {
434
431
  "_name": "livestore.in-memory-db:execute",
@@ -439,12 +436,7 @@ exports[`otel > QueryBuilder subscription - basic functionality 2`] = `
439
436
  {
440
437
  "_name": "@livestore/common:execSql",
441
438
  "attributes": {
442
- "bindValueKeys": [
443
- "$id",
444
- "$seqNumGlobal",
445
- "$seqNumClient",
446
- "$seqNumRebaseGeneration",
447
- ],
439
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
448
440
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
449
441
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
450
442
  },
@@ -453,16 +445,6 @@ exports[`otel > QueryBuilder subscription - basic functionality 2`] = `
453
445
  },
454
446
  ],
455
447
  },
456
- {
457
- "_name": "client-session-sync-processor:push",
458
- "attributes": {
459
- "batchSize": 1,
460
- "eventCounts": "{
461
- "todo.created": 1
462
- }",
463
- "mergeResultTag": "advance",
464
- },
465
- },
466
448
  ],
467
449
  },
468
450
  ]
@@ -476,9 +458,6 @@ exports[`otel > QueryBuilder subscription - direct table subscription 1`] = `
476
458
  "storeId": "default",
477
459
  },
478
460
  "children": [
479
- {
480
- "_name": "makeClientSessionSyncProcessor",
481
- },
482
461
  {
483
462
  "_name": "livestore.in-memory-db:execute",
484
463
  "attributes": {
@@ -491,25 +470,30 @@ exports[`otel > QueryBuilder subscription - direct table subscription 1`] = `
491
470
  ",
492
471
  },
493
472
  },
473
+ {
474
+ "_name": "makeClientSessionSyncProcessor",
475
+ },
494
476
  {
495
477
  "_name": "client-session-sync-processor:boot",
496
478
  "children": [
497
479
  {
498
- "_name": "client-session-sync-processor:pull",
480
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
499
481
  "attributes": {
500
- "effect.fiber.interrupted": true,
482
+ "batch": "undefined",
483
+ "batchSize": 1,
501
484
  },
502
485
  },
503
486
  {
504
- "_name": "@livestore/common:LeaderSyncProcessor:push",
487
+ "_name": "client-session-sync-processor:pull",
505
488
  "attributes": {
506
- "batch": "undefined",
507
- "batchSize": 1,
508
489
  "effect.fiber.interrupted": true,
509
490
  },
510
491
  },
511
492
  ],
512
493
  },
494
+ {
495
+ "_name": "client-session-sync-processor:shutdown",
496
+ },
513
497
  {
514
498
  "_name": "LiveStore:commits",
515
499
  },
@@ -578,13 +562,20 @@ exports[`otel > QueryBuilder subscription - direct table subscription 2`] = `
578
562
  },
579
563
  "children": [
580
564
  {
581
- "_name": "client-session-sync-processor:encode-events",
582
- },
583
- {
584
- "_name": "client-session-sync-processor:materialize-events",
565
+ "_name": "client-session-sync-processor:commit",
566
+ "attributes": {
567
+ "batchSize": 1,
568
+ "eventCounts": "{
569
+ "todo.created": 1
570
+ }",
571
+ "mergeResultTag": "advance",
572
+ },
585
573
  "children": [
586
574
  {
587
- "_name": "client-session-sync-processor:materialize-event",
575
+ "_name": "client-session-sync-processor:encode-events",
576
+ },
577
+ {
578
+ "_name": "client-session-sync-processor:materialize-events",
588
579
  "children": [
589
580
  {
590
581
  "_name": "livestore.in-memory-db:execute",
@@ -595,12 +586,7 @@ exports[`otel > QueryBuilder subscription - direct table subscription 2`] = `
595
586
  {
596
587
  "_name": "@livestore/common:execSql",
597
588
  "attributes": {
598
- "bindValueKeys": [
599
- "$id",
600
- "$seqNumGlobal",
601
- "$seqNumClient",
602
- "$seqNumRebaseGeneration",
603
- ],
589
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
604
590
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
605
591
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
606
592
  },
@@ -609,16 +595,6 @@ exports[`otel > QueryBuilder subscription - direct table subscription 2`] = `
609
595
  },
610
596
  ],
611
597
  },
612
- {
613
- "_name": "client-session-sync-processor:push",
614
- "attributes": {
615
- "batchSize": 1,
616
- "eventCounts": "{
617
- "todo.created": 1
618
- }",
619
- "mergeResultTag": "advance",
620
- },
621
- },
622
598
  ],
623
599
  },
624
600
  ]
@@ -632,9 +608,6 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 1`] = `
632
608
  "storeId": "default",
633
609
  },
634
610
  "children": [
635
- {
636
- "_name": "makeClientSessionSyncProcessor",
637
- },
638
611
  {
639
612
  "_name": "livestore.in-memory-db:execute",
640
613
  "attributes": {
@@ -647,25 +620,30 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 1`] = `
647
620
  ",
648
621
  },
649
622
  },
623
+ {
624
+ "_name": "makeClientSessionSyncProcessor",
625
+ },
650
626
  {
651
627
  "_name": "client-session-sync-processor:boot",
652
628
  "children": [
653
629
  {
654
- "_name": "client-session-sync-processor:pull",
630
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
655
631
  "attributes": {
656
- "effect.fiber.interrupted": true,
632
+ "batch": "undefined",
633
+ "batchSize": 1,
657
634
  },
658
635
  },
659
636
  {
660
- "_name": "@livestore/common:LeaderSyncProcessor:push",
637
+ "_name": "client-session-sync-processor:pull",
661
638
  "attributes": {
662
- "batch": "undefined",
663
- "batchSize": 1,
664
639
  "effect.fiber.interrupted": true,
665
640
  },
666
641
  },
667
642
  ],
668
643
  },
644
+ {
645
+ "_name": "client-session-sync-processor:shutdown",
646
+ },
669
647
  {
670
648
  "_name": "LiveStore:commits",
671
649
  },
@@ -734,13 +712,20 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 2`] = `
734
712
  },
735
713
  "children": [
736
714
  {
737
- "_name": "client-session-sync-processor:encode-events",
738
- },
739
- {
740
- "_name": "client-session-sync-processor:materialize-events",
715
+ "_name": "client-session-sync-processor:commit",
716
+ "attributes": {
717
+ "batchSize": 1,
718
+ "eventCounts": "{
719
+ "todo.created": 1
720
+ }",
721
+ "mergeResultTag": "advance",
722
+ },
741
723
  "children": [
742
724
  {
743
- "_name": "client-session-sync-processor:materialize-event",
725
+ "_name": "client-session-sync-processor:encode-events",
726
+ },
727
+ {
728
+ "_name": "client-session-sync-processor:materialize-events",
744
729
  "children": [
745
730
  {
746
731
  "_name": "livestore.in-memory-db:execute",
@@ -751,12 +736,7 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 2`] = `
751
736
  {
752
737
  "_name": "@livestore/common:execSql",
753
738
  "attributes": {
754
- "bindValueKeys": [
755
- "$id",
756
- "$seqNumGlobal",
757
- "$seqNumClient",
758
- "$seqNumRebaseGeneration",
759
- ],
739
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
760
740
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
761
741
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
762
742
  },
@@ -765,16 +745,6 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 2`] = `
765
745
  },
766
746
  ],
767
747
  },
768
- {
769
- "_name": "client-session-sync-processor:push",
770
- "attributes": {
771
- "batchSize": 1,
772
- "eventCounts": "{
773
- "todo.created": 1
774
- }",
775
- "mergeResultTag": "advance",
776
- },
777
- },
778
748
  ],
779
749
  },
780
750
  ]
@@ -788,9 +758,6 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 1`] = `
788
758
  "storeId": "default",
789
759
  },
790
760
  "children": [
791
- {
792
- "_name": "makeClientSessionSyncProcessor",
793
- },
794
761
  {
795
762
  "_name": "livestore.in-memory-db:execute",
796
763
  "attributes": {
@@ -803,9 +770,19 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 1`] = `
803
770
  ",
804
771
  },
805
772
  },
773
+ {
774
+ "_name": "makeClientSessionSyncProcessor",
775
+ },
806
776
  {
807
777
  "_name": "client-session-sync-processor:boot",
808
778
  "children": [
779
+ {
780
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
781
+ "attributes": {
782
+ "batch": "undefined",
783
+ "batchSize": 1,
784
+ },
785
+ },
809
786
  {
810
787
  "_name": "client-session-sync-processor:pull",
811
788
  "attributes": {
@@ -817,11 +794,13 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 1`] = `
817
794
  "attributes": {
818
795
  "batch": "undefined",
819
796
  "batchSize": 1,
820
- "effect.fiber.interrupted": true,
821
797
  },
822
798
  },
823
799
  ],
824
800
  },
801
+ {
802
+ "_name": "client-session-sync-processor:shutdown",
803
+ },
825
804
  {
826
805
  "_name": "LiveStore:commits",
827
806
  },
@@ -916,13 +895,20 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
916
895
  },
917
896
  "children": [
918
897
  {
919
- "_name": "client-session-sync-processor:encode-events",
920
- },
921
- {
922
- "_name": "client-session-sync-processor:materialize-events",
898
+ "_name": "client-session-sync-processor:commit",
899
+ "attributes": {
900
+ "batchSize": 1,
901
+ "eventCounts": "{
902
+ "todo.created": 1
903
+ }",
904
+ "mergeResultTag": "advance",
905
+ },
923
906
  "children": [
924
907
  {
925
- "_name": "client-session-sync-processor:materialize-event",
908
+ "_name": "client-session-sync-processor:encode-events",
909
+ },
910
+ {
911
+ "_name": "client-session-sync-processor:materialize-events",
926
912
  "children": [
927
913
  {
928
914
  "_name": "livestore.in-memory-db:execute",
@@ -933,12 +919,7 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
933
919
  {
934
920
  "_name": "@livestore/common:execSql",
935
921
  "attributes": {
936
- "bindValueKeys": [
937
- "$id",
938
- "$seqNumGlobal",
939
- "$seqNumClient",
940
- "$seqNumRebaseGeneration",
941
- ],
922
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
942
923
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
943
924
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
944
925
  },
@@ -947,16 +928,6 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
947
928
  },
948
929
  ],
949
930
  },
950
- {
951
- "_name": "client-session-sync-processor:push",
952
- "attributes": {
953
- "batchSize": 1,
954
- "eventCounts": "{
955
- "todo.created": 1
956
- }",
957
- "mergeResultTag": "advance",
958
- },
959
- },
960
931
  ],
961
932
  },
962
933
  {
@@ -969,13 +940,20 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
969
940
  },
970
941
  "children": [
971
942
  {
972
- "_name": "client-session-sync-processor:encode-events",
973
- },
974
- {
975
- "_name": "client-session-sync-processor:materialize-events",
943
+ "_name": "client-session-sync-processor:commit",
944
+ "attributes": {
945
+ "batchSize": 1,
946
+ "eventCounts": "{
947
+ "todo.created": 1
948
+ }",
949
+ "mergeResultTag": "advance",
950
+ },
976
951
  "children": [
977
952
  {
978
- "_name": "client-session-sync-processor:materialize-event",
953
+ "_name": "client-session-sync-processor:encode-events",
954
+ },
955
+ {
956
+ "_name": "client-session-sync-processor:materialize-events",
979
957
  "children": [
980
958
  {
981
959
  "_name": "livestore.in-memory-db:execute",
@@ -986,12 +964,7 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
986
964
  {
987
965
  "_name": "@livestore/common:execSql",
988
966
  "attributes": {
989
- "bindValueKeys": [
990
- "$id",
991
- "$seqNumGlobal",
992
- "$seqNumClient",
993
- "$seqNumRebaseGeneration",
994
- ],
967
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
995
968
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
996
969
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
997
970
  },
@@ -1000,16 +973,6 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
1000
973
  },
1001
974
  ],
1002
975
  },
1003
- {
1004
- "_name": "client-session-sync-processor:push",
1005
- "attributes": {
1006
- "batchSize": 1,
1007
- "eventCounts": "{
1008
- "todo.created": 1
1009
- }",
1010
- "mergeResultTag": "advance",
1011
- },
1012
- },
1013
976
  ],
1014
977
  },
1015
978
  ]
@@ -1023,9 +986,6 @@ exports[`otel > otel 3`] = `
1023
986
  "storeId": "default",
1024
987
  },
1025
988
  "children": [
1026
- {
1027
- "_name": "makeClientSessionSyncProcessor",
1028
- },
1029
989
  {
1030
990
  "_name": "livestore.in-memory-db:execute",
1031
991
  "attributes": {
@@ -1038,25 +998,30 @@ exports[`otel > otel 3`] = `
1038
998
  ",
1039
999
  },
1040
1000
  },
1001
+ {
1002
+ "_name": "makeClientSessionSyncProcessor",
1003
+ },
1041
1004
  {
1042
1005
  "_name": "client-session-sync-processor:boot",
1043
1006
  "children": [
1044
1007
  {
1045
- "_name": "client-session-sync-processor:pull",
1008
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
1046
1009
  "attributes": {
1047
- "effect.fiber.interrupted": true,
1010
+ "batch": "undefined",
1011
+ "batchSize": 1,
1048
1012
  },
1049
1013
  },
1050
1014
  {
1051
- "_name": "@livestore/common:LeaderSyncProcessor:push",
1015
+ "_name": "client-session-sync-processor:pull",
1052
1016
  "attributes": {
1053
- "batch": "undefined",
1054
- "batchSize": 1,
1055
1017
  "effect.fiber.interrupted": true,
1056
1018
  },
1057
1019
  },
1058
1020
  ],
1059
1021
  },
1022
+ {
1023
+ "_name": "client-session-sync-processor:shutdown",
1024
+ },
1060
1025
  {
1061
1026
  "_name": "LiveStore:commits",
1062
1027
  },
@@ -1115,13 +1080,20 @@ exports[`otel > otel 4`] = `
1115
1080
  },
1116
1081
  "children": [
1117
1082
  {
1118
- "_name": "client-session-sync-processor:encode-events",
1119
- },
1120
- {
1121
- "_name": "client-session-sync-processor:materialize-events",
1083
+ "_name": "client-session-sync-processor:commit",
1084
+ "attributes": {
1085
+ "batchSize": 1,
1086
+ "eventCounts": "{
1087
+ "todo.created": 1
1088
+ }",
1089
+ "mergeResultTag": "advance",
1090
+ },
1122
1091
  "children": [
1123
1092
  {
1124
- "_name": "client-session-sync-processor:materialize-event",
1093
+ "_name": "client-session-sync-processor:encode-events",
1094
+ },
1095
+ {
1096
+ "_name": "client-session-sync-processor:materialize-events",
1125
1097
  "children": [
1126
1098
  {
1127
1099
  "_name": "livestore.in-memory-db:execute",
@@ -1132,12 +1104,7 @@ exports[`otel > otel 4`] = `
1132
1104
  {
1133
1105
  "_name": "@livestore/common:execSql",
1134
1106
  "attributes": {
1135
- "bindValueKeys": [
1136
- "$id",
1137
- "$seqNumGlobal",
1138
- "$seqNumClient",
1139
- "$seqNumRebaseGeneration",
1140
- ],
1107
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
1141
1108
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1142
1109
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1143
1110
  },
@@ -1146,16 +1113,6 @@ exports[`otel > otel 4`] = `
1146
1113
  },
1147
1114
  ],
1148
1115
  },
1149
- {
1150
- "_name": "client-session-sync-processor:push",
1151
- "attributes": {
1152
- "batchSize": 1,
1153
- "eventCounts": "{
1154
- "todo.created": 1
1155
- }",
1156
- "mergeResultTag": "advance",
1157
- },
1158
- },
1159
1116
  ],
1160
1117
  },
1161
1118
  ]
@@ -1341,9 +1298,6 @@ exports[`otel > with thunks 7`] = `
1341
1298
  "storeId": "default",
1342
1299
  },
1343
1300
  "children": [
1344
- {
1345
- "_name": "makeClientSessionSyncProcessor",
1346
- },
1347
1301
  {
1348
1302
  "_name": "livestore.in-memory-db:execute",
1349
1303
  "attributes": {
@@ -1356,25 +1310,30 @@ exports[`otel > with thunks 7`] = `
1356
1310
  ",
1357
1311
  },
1358
1312
  },
1313
+ {
1314
+ "_name": "makeClientSessionSyncProcessor",
1315
+ },
1359
1316
  {
1360
1317
  "_name": "client-session-sync-processor:boot",
1361
1318
  "children": [
1362
1319
  {
1363
- "_name": "client-session-sync-processor:pull",
1320
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
1364
1321
  "attributes": {
1365
- "effect.fiber.interrupted": true,
1322
+ "batch": "undefined",
1323
+ "batchSize": 1,
1366
1324
  },
1367
1325
  },
1368
1326
  {
1369
- "_name": "@livestore/common:LeaderSyncProcessor:push",
1327
+ "_name": "client-session-sync-processor:pull",
1370
1328
  "attributes": {
1371
- "batch": "undefined",
1372
- "batchSize": 1,
1373
1329
  "effect.fiber.interrupted": true,
1374
1330
  },
1375
1331
  },
1376
1332
  ],
1377
1333
  },
1334
+ {
1335
+ "_name": "client-session-sync-processor:shutdown",
1336
+ },
1378
1337
  {
1379
1338
  "_name": "LiveStore:commits",
1380
1339
  },
@@ -1439,13 +1398,20 @@ exports[`otel > with thunks 8`] = `
1439
1398
  },
1440
1399
  "children": [
1441
1400
  {
1442
- "_name": "client-session-sync-processor:encode-events",
1443
- },
1444
- {
1445
- "_name": "client-session-sync-processor:materialize-events",
1401
+ "_name": "client-session-sync-processor:commit",
1402
+ "attributes": {
1403
+ "batchSize": 1,
1404
+ "eventCounts": "{
1405
+ "todo.created": 1
1406
+ }",
1407
+ "mergeResultTag": "advance",
1408
+ },
1446
1409
  "children": [
1447
1410
  {
1448
- "_name": "client-session-sync-processor:materialize-event",
1411
+ "_name": "client-session-sync-processor:encode-events",
1412
+ },
1413
+ {
1414
+ "_name": "client-session-sync-processor:materialize-events",
1449
1415
  "children": [
1450
1416
  {
1451
1417
  "_name": "livestore.in-memory-db:execute",
@@ -1456,12 +1422,7 @@ exports[`otel > with thunks 8`] = `
1456
1422
  {
1457
1423
  "_name": "@livestore/common:execSql",
1458
1424
  "attributes": {
1459
- "bindValueKeys": [
1460
- "$id",
1461
- "$seqNumGlobal",
1462
- "$seqNumClient",
1463
- "$seqNumRebaseGeneration",
1464
- ],
1425
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
1465
1426
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1466
1427
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1467
1428
  },
@@ -1470,16 +1431,6 @@ exports[`otel > with thunks 8`] = `
1470
1431
  },
1471
1432
  ],
1472
1433
  },
1473
- {
1474
- "_name": "client-session-sync-processor:push",
1475
- "attributes": {
1476
- "batchSize": 1,
1477
- "eventCounts": "{
1478
- "todo.created": 1
1479
- }",
1480
- "mergeResultTag": "advance",
1481
- },
1482
- },
1483
1434
  ],
1484
1435
  },
1485
1436
  ]
@@ -1493,9 +1444,6 @@ exports[`otel > with thunks with query builder and without labels 3`] = `
1493
1444
  "storeId": "default",
1494
1445
  },
1495
1446
  "children": [
1496
- {
1497
- "_name": "makeClientSessionSyncProcessor",
1498
- },
1499
1447
  {
1500
1448
  "_name": "livestore.in-memory-db:execute",
1501
1449
  "attributes": {
@@ -1508,25 +1456,30 @@ exports[`otel > with thunks with query builder and without labels 3`] = `
1508
1456
  ",
1509
1457
  },
1510
1458
  },
1459
+ {
1460
+ "_name": "makeClientSessionSyncProcessor",
1461
+ },
1511
1462
  {
1512
1463
  "_name": "client-session-sync-processor:boot",
1513
1464
  "children": [
1514
1465
  {
1515
- "_name": "client-session-sync-processor:pull",
1466
+ "_name": "@livestore/common:LeaderSyncProcessor:push",
1516
1467
  "attributes": {
1517
- "effect.fiber.interrupted": true,
1468
+ "batch": "undefined",
1469
+ "batchSize": 1,
1518
1470
  },
1519
1471
  },
1520
1472
  {
1521
- "_name": "@livestore/common:LeaderSyncProcessor:push",
1473
+ "_name": "client-session-sync-processor:pull",
1522
1474
  "attributes": {
1523
- "batch": "undefined",
1524
- "batchSize": 1,
1525
1475
  "effect.fiber.interrupted": true,
1526
1476
  },
1527
1477
  },
1528
1478
  ],
1529
1479
  },
1480
+ {
1481
+ "_name": "client-session-sync-processor:shutdown",
1482
+ },
1530
1483
  {
1531
1484
  "_name": "LiveStore:commits",
1532
1485
  },
@@ -1591,13 +1544,20 @@ exports[`otel > with thunks with query builder and without labels 4`] = `
1591
1544
  },
1592
1545
  "children": [
1593
1546
  {
1594
- "_name": "client-session-sync-processor:encode-events",
1595
- },
1596
- {
1597
- "_name": "client-session-sync-processor:materialize-events",
1547
+ "_name": "client-session-sync-processor:commit",
1548
+ "attributes": {
1549
+ "batchSize": 1,
1550
+ "eventCounts": "{
1551
+ "todo.created": 1
1552
+ }",
1553
+ "mergeResultTag": "advance",
1554
+ },
1598
1555
  "children": [
1599
1556
  {
1600
- "_name": "client-session-sync-processor:materialize-event",
1557
+ "_name": "client-session-sync-processor:encode-events",
1558
+ },
1559
+ {
1560
+ "_name": "client-session-sync-processor:materialize-events",
1601
1561
  "children": [
1602
1562
  {
1603
1563
  "_name": "livestore.in-memory-db:execute",
@@ -1608,12 +1568,7 @@ exports[`otel > with thunks with query builder and without labels 4`] = `
1608
1568
  {
1609
1569
  "_name": "@livestore/common:execSql",
1610
1570
  "attributes": {
1611
- "bindValueKeys": [
1612
- "$id",
1613
- "$seqNumGlobal",
1614
- "$seqNumClient",
1615
- "$seqNumRebaseGeneration",
1616
- ],
1571
+ "bindValueKeys": "$id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration",
1617
1572
  "span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1618
1573
  "sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
1619
1574
  },
@@ -1622,16 +1577,6 @@ exports[`otel > with thunks with query builder and without labels 4`] = `
1622
1577
  },
1623
1578
  ],
1624
1579
  },
1625
- {
1626
- "_name": "client-session-sync-processor:push",
1627
- "attributes": {
1628
- "batchSize": 1,
1629
- "eventCounts": "{
1630
- "todo.created": 1
1631
- }",
1632
- "mergeResultTag": "advance",
1633
- },
1634
- },
1635
1580
  ],
1636
1581
  },
1637
1582
  ]