@rivetkit/engine-envoy-protocol 0.0.0-pr.4856.c68d9cb → 0.0.0-pr.4860.2a8ccdf
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/dist/index.d.ts +507 -9
- package/dist/index.js +1429 -143
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import * as bare from "@rivetkit/bare-ts";
|
|
3
|
+
var DEFAULT_CONFIG = /* @__PURE__ */ bare.Config({});
|
|
3
4
|
function readId(bc) {
|
|
4
5
|
return bare.readString(bc);
|
|
5
6
|
}
|
|
@@ -365,18 +366,66 @@ function writeKvResponseData(bc, x) {
|
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
368
|
}
|
|
369
|
+
function readSqliteGeneration(bc) {
|
|
370
|
+
return bare.readU64(bc);
|
|
371
|
+
}
|
|
372
|
+
function writeSqliteGeneration(bc, x) {
|
|
373
|
+
bare.writeU64(bc, x);
|
|
374
|
+
}
|
|
375
|
+
function readSqliteTxid(bc) {
|
|
376
|
+
return bare.readU64(bc);
|
|
377
|
+
}
|
|
378
|
+
function writeSqliteTxid(bc, x) {
|
|
379
|
+
bare.writeU64(bc, x);
|
|
380
|
+
}
|
|
368
381
|
function readSqlitePgno(bc) {
|
|
369
382
|
return bare.readU32(bc);
|
|
370
383
|
}
|
|
371
384
|
function writeSqlitePgno(bc, x) {
|
|
372
385
|
bare.writeU32(bc, x);
|
|
373
386
|
}
|
|
387
|
+
function readSqliteStageId(bc) {
|
|
388
|
+
return bare.readU64(bc);
|
|
389
|
+
}
|
|
390
|
+
function writeSqliteStageId(bc, x) {
|
|
391
|
+
bare.writeU64(bc, x);
|
|
392
|
+
}
|
|
374
393
|
function readSqlitePageBytes(bc) {
|
|
375
394
|
return bare.readData(bc);
|
|
376
395
|
}
|
|
377
396
|
function writeSqlitePageBytes(bc, x) {
|
|
378
397
|
bare.writeData(bc, x);
|
|
379
398
|
}
|
|
399
|
+
function readSqliteMeta(bc) {
|
|
400
|
+
return {
|
|
401
|
+
generation: readSqliteGeneration(bc),
|
|
402
|
+
headTxid: readSqliteTxid(bc),
|
|
403
|
+
materializedTxid: readSqliteTxid(bc),
|
|
404
|
+
dbSizePages: bare.readU32(bc),
|
|
405
|
+
pageSize: bare.readU32(bc),
|
|
406
|
+
creationTsMs: bare.readI64(bc),
|
|
407
|
+
maxDeltaBytes: bare.readU64(bc)
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function writeSqliteMeta(bc, x) {
|
|
411
|
+
writeSqliteGeneration(bc, x.generation);
|
|
412
|
+
writeSqliteTxid(bc, x.headTxid);
|
|
413
|
+
writeSqliteTxid(bc, x.materializedTxid);
|
|
414
|
+
bare.writeU32(bc, x.dbSizePages);
|
|
415
|
+
bare.writeU32(bc, x.pageSize);
|
|
416
|
+
bare.writeI64(bc, x.creationTsMs);
|
|
417
|
+
bare.writeU64(bc, x.maxDeltaBytes);
|
|
418
|
+
}
|
|
419
|
+
function readSqliteFenceMismatch(bc) {
|
|
420
|
+
return {
|
|
421
|
+
actualMeta: readSqliteMeta(bc),
|
|
422
|
+
reason: bare.readString(bc)
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function writeSqliteFenceMismatch(bc, x) {
|
|
426
|
+
writeSqliteMeta(bc, x.actualMeta);
|
|
427
|
+
bare.writeString(bc, x.reason);
|
|
428
|
+
}
|
|
380
429
|
function readSqliteDirtyPage(bc) {
|
|
381
430
|
return {
|
|
382
431
|
pgno: readSqlitePgno(bc),
|
|
@@ -426,16 +475,30 @@ function write6(bc, x) {
|
|
|
426
475
|
function readSqliteGetPagesRequest(bc) {
|
|
427
476
|
return {
|
|
428
477
|
actorId: readId(bc),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
expectedHeadTxid: read2(bc)
|
|
478
|
+
generation: readSqliteGeneration(bc),
|
|
479
|
+
pgnos: read6(bc)
|
|
432
480
|
};
|
|
433
481
|
}
|
|
434
482
|
function writeSqliteGetPagesRequest(bc, x) {
|
|
435
483
|
writeId(bc, x.actorId);
|
|
484
|
+
writeSqliteGeneration(bc, x.generation);
|
|
436
485
|
write6(bc, x.pgnos);
|
|
437
|
-
|
|
438
|
-
|
|
486
|
+
}
|
|
487
|
+
function readSqliteGetPageRangeRequest(bc) {
|
|
488
|
+
return {
|
|
489
|
+
actorId: readId(bc),
|
|
490
|
+
generation: readSqliteGeneration(bc),
|
|
491
|
+
startPgno: readSqlitePgno(bc),
|
|
492
|
+
maxPages: bare.readU32(bc),
|
|
493
|
+
maxBytes: bare.readU64(bc)
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function writeSqliteGetPageRangeRequest(bc, x) {
|
|
497
|
+
writeId(bc, x.actorId);
|
|
498
|
+
writeSqliteGeneration(bc, x.generation);
|
|
499
|
+
writeSqlitePgno(bc, x.startPgno);
|
|
500
|
+
bare.writeU32(bc, x.maxPages);
|
|
501
|
+
bare.writeU64(bc, x.maxBytes);
|
|
439
502
|
}
|
|
440
503
|
function read7(bc) {
|
|
441
504
|
const len = bare.readUintSafe(bc);
|
|
@@ -454,29 +517,846 @@ function write7(bc, x) {
|
|
|
454
517
|
writeSqliteFetchedPage(bc, x[i]);
|
|
455
518
|
}
|
|
456
519
|
}
|
|
457
|
-
function readSqliteGetPagesOk(bc) {
|
|
520
|
+
function readSqliteGetPagesOk(bc) {
|
|
521
|
+
return {
|
|
522
|
+
pages: read7(bc),
|
|
523
|
+
meta: readSqliteMeta(bc)
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function writeSqliteGetPagesOk(bc, x) {
|
|
527
|
+
write7(bc, x.pages);
|
|
528
|
+
writeSqliteMeta(bc, x.meta);
|
|
529
|
+
}
|
|
530
|
+
function readSqliteGetPageRangeOk(bc) {
|
|
531
|
+
return {
|
|
532
|
+
startPgno: readSqlitePgno(bc),
|
|
533
|
+
pages: read7(bc),
|
|
534
|
+
meta: readSqliteMeta(bc)
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function writeSqliteGetPageRangeOk(bc, x) {
|
|
538
|
+
writeSqlitePgno(bc, x.startPgno);
|
|
539
|
+
write7(bc, x.pages);
|
|
540
|
+
writeSqliteMeta(bc, x.meta);
|
|
541
|
+
}
|
|
542
|
+
function readSqliteErrorResponse(bc) {
|
|
543
|
+
return {
|
|
544
|
+
message: bare.readString(bc)
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function writeSqliteErrorResponse(bc, x) {
|
|
548
|
+
bare.writeString(bc, x.message);
|
|
549
|
+
}
|
|
550
|
+
function readSqliteGetPagesResponse(bc) {
|
|
551
|
+
const offset = bc.offset;
|
|
552
|
+
const tag = bare.readU8(bc);
|
|
553
|
+
switch (tag) {
|
|
554
|
+
case 0:
|
|
555
|
+
return { tag: "SqliteGetPagesOk", val: readSqliteGetPagesOk(bc) };
|
|
556
|
+
case 1:
|
|
557
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
558
|
+
case 2:
|
|
559
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
560
|
+
default: {
|
|
561
|
+
bc.offset = offset;
|
|
562
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
function writeSqliteGetPagesResponse(bc, x) {
|
|
567
|
+
switch (x.tag) {
|
|
568
|
+
case "SqliteGetPagesOk": {
|
|
569
|
+
bare.writeU8(bc, 0);
|
|
570
|
+
writeSqliteGetPagesOk(bc, x.val);
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
case "SqliteFenceMismatch": {
|
|
574
|
+
bare.writeU8(bc, 1);
|
|
575
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
case "SqliteErrorResponse": {
|
|
579
|
+
bare.writeU8(bc, 2);
|
|
580
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
function readSqliteGetPageRangeResponse(bc) {
|
|
586
|
+
const offset = bc.offset;
|
|
587
|
+
const tag = bare.readU8(bc);
|
|
588
|
+
switch (tag) {
|
|
589
|
+
case 0:
|
|
590
|
+
return { tag: "SqliteGetPageRangeOk", val: readSqliteGetPageRangeOk(bc) };
|
|
591
|
+
case 1:
|
|
592
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
593
|
+
case 2:
|
|
594
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
595
|
+
default: {
|
|
596
|
+
bc.offset = offset;
|
|
597
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function writeSqliteGetPageRangeResponse(bc, x) {
|
|
602
|
+
switch (x.tag) {
|
|
603
|
+
case "SqliteGetPageRangeOk": {
|
|
604
|
+
bare.writeU8(bc, 0);
|
|
605
|
+
writeSqliteGetPageRangeOk(bc, x.val);
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
case "SqliteFenceMismatch": {
|
|
609
|
+
bare.writeU8(bc, 1);
|
|
610
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
case "SqliteErrorResponse": {
|
|
614
|
+
bare.writeU8(bc, 2);
|
|
615
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function read8(bc) {
|
|
621
|
+
const len = bare.readUintSafe(bc);
|
|
622
|
+
if (len === 0) {
|
|
623
|
+
return [];
|
|
624
|
+
}
|
|
625
|
+
const result = [readSqliteDirtyPage(bc)];
|
|
626
|
+
for (let i = 1; i < len; i++) {
|
|
627
|
+
result[i] = readSqliteDirtyPage(bc);
|
|
628
|
+
}
|
|
629
|
+
return result;
|
|
630
|
+
}
|
|
631
|
+
function write8(bc, x) {
|
|
632
|
+
bare.writeUintSafe(bc, x.length);
|
|
633
|
+
for (let i = 0; i < x.length; i++) {
|
|
634
|
+
writeSqliteDirtyPage(bc, x[i]);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
function readSqliteCommitRequest(bc) {
|
|
638
|
+
return {
|
|
639
|
+
actorId: readId(bc),
|
|
640
|
+
generation: readSqliteGeneration(bc),
|
|
641
|
+
expectedHeadTxid: readSqliteTxid(bc),
|
|
642
|
+
dirtyPages: read8(bc),
|
|
643
|
+
newDbSizePages: bare.readU32(bc)
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function writeSqliteCommitRequest(bc, x) {
|
|
647
|
+
writeId(bc, x.actorId);
|
|
648
|
+
writeSqliteGeneration(bc, x.generation);
|
|
649
|
+
writeSqliteTxid(bc, x.expectedHeadTxid);
|
|
650
|
+
write8(bc, x.dirtyPages);
|
|
651
|
+
bare.writeU32(bc, x.newDbSizePages);
|
|
652
|
+
}
|
|
653
|
+
function readSqliteCommitOk(bc) {
|
|
654
|
+
return {
|
|
655
|
+
newHeadTxid: readSqliteTxid(bc),
|
|
656
|
+
meta: readSqliteMeta(bc)
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
function writeSqliteCommitOk(bc, x) {
|
|
660
|
+
writeSqliteTxid(bc, x.newHeadTxid);
|
|
661
|
+
writeSqliteMeta(bc, x.meta);
|
|
662
|
+
}
|
|
663
|
+
function readSqliteCommitTooLarge(bc) {
|
|
664
|
+
return {
|
|
665
|
+
actualSizeBytes: bare.readU64(bc),
|
|
666
|
+
maxSizeBytes: bare.readU64(bc)
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function writeSqliteCommitTooLarge(bc, x) {
|
|
670
|
+
bare.writeU64(bc, x.actualSizeBytes);
|
|
671
|
+
bare.writeU64(bc, x.maxSizeBytes);
|
|
672
|
+
}
|
|
673
|
+
function readSqliteCommitResponse(bc) {
|
|
674
|
+
const offset = bc.offset;
|
|
675
|
+
const tag = bare.readU8(bc);
|
|
676
|
+
switch (tag) {
|
|
677
|
+
case 0:
|
|
678
|
+
return { tag: "SqliteCommitOk", val: readSqliteCommitOk(bc) };
|
|
679
|
+
case 1:
|
|
680
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
681
|
+
case 2:
|
|
682
|
+
return { tag: "SqliteCommitTooLarge", val: readSqliteCommitTooLarge(bc) };
|
|
683
|
+
case 3:
|
|
684
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
685
|
+
default: {
|
|
686
|
+
bc.offset = offset;
|
|
687
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
function writeSqliteCommitResponse(bc, x) {
|
|
692
|
+
switch (x.tag) {
|
|
693
|
+
case "SqliteCommitOk": {
|
|
694
|
+
bare.writeU8(bc, 0);
|
|
695
|
+
writeSqliteCommitOk(bc, x.val);
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
case "SqliteFenceMismatch": {
|
|
699
|
+
bare.writeU8(bc, 1);
|
|
700
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
case "SqliteCommitTooLarge": {
|
|
704
|
+
bare.writeU8(bc, 2);
|
|
705
|
+
writeSqliteCommitTooLarge(bc, x.val);
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
case "SqliteErrorResponse": {
|
|
709
|
+
bare.writeU8(bc, 3);
|
|
710
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
function readSqliteCommitStageBeginRequest(bc) {
|
|
716
|
+
return {
|
|
717
|
+
actorId: readId(bc),
|
|
718
|
+
generation: readSqliteGeneration(bc)
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function writeSqliteCommitStageBeginRequest(bc, x) {
|
|
722
|
+
writeId(bc, x.actorId);
|
|
723
|
+
writeSqliteGeneration(bc, x.generation);
|
|
724
|
+
}
|
|
725
|
+
function readSqliteCommitStageBeginOk(bc) {
|
|
726
|
+
return {
|
|
727
|
+
txid: readSqliteTxid(bc)
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function writeSqliteCommitStageBeginOk(bc, x) {
|
|
731
|
+
writeSqliteTxid(bc, x.txid);
|
|
732
|
+
}
|
|
733
|
+
function readSqliteCommitStageBeginResponse(bc) {
|
|
734
|
+
const offset = bc.offset;
|
|
735
|
+
const tag = bare.readU8(bc);
|
|
736
|
+
switch (tag) {
|
|
737
|
+
case 0:
|
|
738
|
+
return { tag: "SqliteCommitStageBeginOk", val: readSqliteCommitStageBeginOk(bc) };
|
|
739
|
+
case 1:
|
|
740
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
741
|
+
case 2:
|
|
742
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
743
|
+
default: {
|
|
744
|
+
bc.offset = offset;
|
|
745
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function writeSqliteCommitStageBeginResponse(bc, x) {
|
|
750
|
+
switch (x.tag) {
|
|
751
|
+
case "SqliteCommitStageBeginOk": {
|
|
752
|
+
bare.writeU8(bc, 0);
|
|
753
|
+
writeSqliteCommitStageBeginOk(bc, x.val);
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case "SqliteFenceMismatch": {
|
|
757
|
+
bare.writeU8(bc, 1);
|
|
758
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
case "SqliteErrorResponse": {
|
|
762
|
+
bare.writeU8(bc, 2);
|
|
763
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
function readSqliteCommitStageRequest(bc) {
|
|
769
|
+
return {
|
|
770
|
+
actorId: readId(bc),
|
|
771
|
+
generation: readSqliteGeneration(bc),
|
|
772
|
+
txid: readSqliteTxid(bc),
|
|
773
|
+
chunkIdx: bare.readU32(bc),
|
|
774
|
+
bytes: bare.readData(bc),
|
|
775
|
+
isLast: bare.readBool(bc)
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
function writeSqliteCommitStageRequest(bc, x) {
|
|
779
|
+
writeId(bc, x.actorId);
|
|
780
|
+
writeSqliteGeneration(bc, x.generation);
|
|
781
|
+
writeSqliteTxid(bc, x.txid);
|
|
782
|
+
bare.writeU32(bc, x.chunkIdx);
|
|
783
|
+
bare.writeData(bc, x.bytes);
|
|
784
|
+
bare.writeBool(bc, x.isLast);
|
|
785
|
+
}
|
|
786
|
+
function readSqliteCommitStageOk(bc) {
|
|
787
|
+
return {
|
|
788
|
+
chunkIdxCommitted: bare.readU32(bc)
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
function writeSqliteCommitStageOk(bc, x) {
|
|
792
|
+
bare.writeU32(bc, x.chunkIdxCommitted);
|
|
793
|
+
}
|
|
794
|
+
function readSqliteCommitStageResponse(bc) {
|
|
795
|
+
const offset = bc.offset;
|
|
796
|
+
const tag = bare.readU8(bc);
|
|
797
|
+
switch (tag) {
|
|
798
|
+
case 0:
|
|
799
|
+
return { tag: "SqliteCommitStageOk", val: readSqliteCommitStageOk(bc) };
|
|
800
|
+
case 1:
|
|
801
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
802
|
+
case 2:
|
|
803
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
804
|
+
default: {
|
|
805
|
+
bc.offset = offset;
|
|
806
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
function writeSqliteCommitStageResponse(bc, x) {
|
|
811
|
+
switch (x.tag) {
|
|
812
|
+
case "SqliteCommitStageOk": {
|
|
813
|
+
bare.writeU8(bc, 0);
|
|
814
|
+
writeSqliteCommitStageOk(bc, x.val);
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
case "SqliteFenceMismatch": {
|
|
818
|
+
bare.writeU8(bc, 1);
|
|
819
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
820
|
+
break;
|
|
821
|
+
}
|
|
822
|
+
case "SqliteErrorResponse": {
|
|
823
|
+
bare.writeU8(bc, 2);
|
|
824
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
function readSqliteCommitFinalizeRequest(bc) {
|
|
830
|
+
return {
|
|
831
|
+
actorId: readId(bc),
|
|
832
|
+
generation: readSqliteGeneration(bc),
|
|
833
|
+
expectedHeadTxid: readSqliteTxid(bc),
|
|
834
|
+
txid: readSqliteTxid(bc),
|
|
835
|
+
newDbSizePages: bare.readU32(bc)
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
function writeSqliteCommitFinalizeRequest(bc, x) {
|
|
839
|
+
writeId(bc, x.actorId);
|
|
840
|
+
writeSqliteGeneration(bc, x.generation);
|
|
841
|
+
writeSqliteTxid(bc, x.expectedHeadTxid);
|
|
842
|
+
writeSqliteTxid(bc, x.txid);
|
|
843
|
+
bare.writeU32(bc, x.newDbSizePages);
|
|
844
|
+
}
|
|
845
|
+
function readSqliteCommitFinalizeOk(bc) {
|
|
846
|
+
return {
|
|
847
|
+
newHeadTxid: readSqliteTxid(bc),
|
|
848
|
+
meta: readSqliteMeta(bc)
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
function writeSqliteCommitFinalizeOk(bc, x) {
|
|
852
|
+
writeSqliteTxid(bc, x.newHeadTxid);
|
|
853
|
+
writeSqliteMeta(bc, x.meta);
|
|
854
|
+
}
|
|
855
|
+
function readSqliteStageNotFound(bc) {
|
|
856
|
+
return {
|
|
857
|
+
stageId: readSqliteStageId(bc)
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function writeSqliteStageNotFound(bc, x) {
|
|
861
|
+
writeSqliteStageId(bc, x.stageId);
|
|
862
|
+
}
|
|
863
|
+
function readSqliteCommitFinalizeResponse(bc) {
|
|
864
|
+
const offset = bc.offset;
|
|
865
|
+
const tag = bare.readU8(bc);
|
|
866
|
+
switch (tag) {
|
|
867
|
+
case 0:
|
|
868
|
+
return { tag: "SqliteCommitFinalizeOk", val: readSqliteCommitFinalizeOk(bc) };
|
|
869
|
+
case 1:
|
|
870
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
871
|
+
case 2:
|
|
872
|
+
return { tag: "SqliteStageNotFound", val: readSqliteStageNotFound(bc) };
|
|
873
|
+
case 3:
|
|
874
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
875
|
+
default: {
|
|
876
|
+
bc.offset = offset;
|
|
877
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
function writeSqliteCommitFinalizeResponse(bc, x) {
|
|
882
|
+
switch (x.tag) {
|
|
883
|
+
case "SqliteCommitFinalizeOk": {
|
|
884
|
+
bare.writeU8(bc, 0);
|
|
885
|
+
writeSqliteCommitFinalizeOk(bc, x.val);
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
case "SqliteFenceMismatch": {
|
|
889
|
+
bare.writeU8(bc, 1);
|
|
890
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
case "SqliteStageNotFound": {
|
|
894
|
+
bare.writeU8(bc, 2);
|
|
895
|
+
writeSqliteStageNotFound(bc, x.val);
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
case "SqliteErrorResponse": {
|
|
899
|
+
bare.writeU8(bc, 3);
|
|
900
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
function readSqlitePreloadHintRange(bc) {
|
|
906
|
+
return {
|
|
907
|
+
startPgno: readSqlitePgno(bc),
|
|
908
|
+
pageCount: bare.readU32(bc)
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
function writeSqlitePreloadHintRange(bc, x) {
|
|
912
|
+
writeSqlitePgno(bc, x.startPgno);
|
|
913
|
+
bare.writeU32(bc, x.pageCount);
|
|
914
|
+
}
|
|
915
|
+
function read9(bc) {
|
|
916
|
+
const len = bare.readUintSafe(bc);
|
|
917
|
+
if (len === 0) {
|
|
918
|
+
return [];
|
|
919
|
+
}
|
|
920
|
+
const result = [readSqlitePreloadHintRange(bc)];
|
|
921
|
+
for (let i = 1; i < len; i++) {
|
|
922
|
+
result[i] = readSqlitePreloadHintRange(bc);
|
|
923
|
+
}
|
|
924
|
+
return result;
|
|
925
|
+
}
|
|
926
|
+
function write9(bc, x) {
|
|
927
|
+
bare.writeUintSafe(bc, x.length);
|
|
928
|
+
for (let i = 0; i < x.length; i++) {
|
|
929
|
+
writeSqlitePreloadHintRange(bc, x[i]);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
function readSqlitePreloadHints(bc) {
|
|
933
|
+
return {
|
|
934
|
+
pgnos: read6(bc),
|
|
935
|
+
ranges: read9(bc)
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function writeSqlitePreloadHints(bc, x) {
|
|
939
|
+
write6(bc, x.pgnos);
|
|
940
|
+
write9(bc, x.ranges);
|
|
941
|
+
}
|
|
942
|
+
function readSqlitePersistPreloadHintsRequest(bc) {
|
|
943
|
+
return {
|
|
944
|
+
actorId: readId(bc),
|
|
945
|
+
generation: readSqliteGeneration(bc),
|
|
946
|
+
hints: readSqlitePreloadHints(bc)
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function writeSqlitePersistPreloadHintsRequest(bc, x) {
|
|
950
|
+
writeId(bc, x.actorId);
|
|
951
|
+
writeSqliteGeneration(bc, x.generation);
|
|
952
|
+
writeSqlitePreloadHints(bc, x.hints);
|
|
953
|
+
}
|
|
954
|
+
function readSqlitePersistPreloadHintsResponse(bc) {
|
|
955
|
+
const offset = bc.offset;
|
|
956
|
+
const tag = bare.readU8(bc);
|
|
957
|
+
switch (tag) {
|
|
958
|
+
case 0:
|
|
959
|
+
return { tag: "SqlitePersistPreloadHintsOk", val: null };
|
|
960
|
+
case 1:
|
|
961
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
962
|
+
case 2:
|
|
963
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
964
|
+
default: {
|
|
965
|
+
bc.offset = offset;
|
|
966
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function writeSqlitePersistPreloadHintsResponse(bc, x) {
|
|
971
|
+
switch (x.tag) {
|
|
972
|
+
case "SqlitePersistPreloadHintsOk": {
|
|
973
|
+
bare.writeU8(bc, 0);
|
|
974
|
+
break;
|
|
975
|
+
}
|
|
976
|
+
case "SqliteFenceMismatch": {
|
|
977
|
+
bare.writeU8(bc, 1);
|
|
978
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
979
|
+
break;
|
|
980
|
+
}
|
|
981
|
+
case "SqliteErrorResponse": {
|
|
982
|
+
bare.writeU8(bc, 2);
|
|
983
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
984
|
+
break;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function readSqliteStartupData(bc) {
|
|
989
|
+
return {
|
|
990
|
+
generation: readSqliteGeneration(bc),
|
|
991
|
+
meta: readSqliteMeta(bc),
|
|
992
|
+
preloadedPages: read7(bc)
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function writeSqliteStartupData(bc, x) {
|
|
996
|
+
writeSqliteGeneration(bc, x.generation);
|
|
997
|
+
writeSqliteMeta(bc, x.meta);
|
|
998
|
+
write7(bc, x.preloadedPages);
|
|
999
|
+
}
|
|
1000
|
+
function readSqliteValueInteger(bc) {
|
|
1001
|
+
return {
|
|
1002
|
+
value: bare.readI64(bc)
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
function writeSqliteValueInteger(bc, x) {
|
|
1006
|
+
bare.writeI64(bc, x.value);
|
|
1007
|
+
}
|
|
1008
|
+
function readSqliteValueFloat(bc) {
|
|
1009
|
+
return {
|
|
1010
|
+
value: bare.readFixedData(bc, 8)
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
function writeSqliteValueFloat(bc, x) {
|
|
1014
|
+
{
|
|
1015
|
+
assert(x.value.byteLength === 8);
|
|
1016
|
+
bare.writeFixedData(bc, x.value);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
function readSqliteValueText(bc) {
|
|
1020
|
+
return {
|
|
1021
|
+
value: bare.readString(bc)
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
function writeSqliteValueText(bc, x) {
|
|
1025
|
+
bare.writeString(bc, x.value);
|
|
1026
|
+
}
|
|
1027
|
+
function readSqliteValueBlob(bc) {
|
|
1028
|
+
return {
|
|
1029
|
+
value: bare.readData(bc)
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
function writeSqliteValueBlob(bc, x) {
|
|
1033
|
+
bare.writeData(bc, x.value);
|
|
1034
|
+
}
|
|
1035
|
+
function readSqliteBindParam(bc) {
|
|
1036
|
+
const offset = bc.offset;
|
|
1037
|
+
const tag = bare.readU8(bc);
|
|
1038
|
+
switch (tag) {
|
|
1039
|
+
case 0:
|
|
1040
|
+
return { tag: "SqliteValueNull", val: null };
|
|
1041
|
+
case 1:
|
|
1042
|
+
return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
|
|
1043
|
+
case 2:
|
|
1044
|
+
return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
|
|
1045
|
+
case 3:
|
|
1046
|
+
return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
|
|
1047
|
+
case 4:
|
|
1048
|
+
return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
|
|
1049
|
+
default: {
|
|
1050
|
+
bc.offset = offset;
|
|
1051
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
function writeSqliteBindParam(bc, x) {
|
|
1056
|
+
switch (x.tag) {
|
|
1057
|
+
case "SqliteValueNull": {
|
|
1058
|
+
bare.writeU8(bc, 0);
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
case "SqliteValueInteger": {
|
|
1062
|
+
bare.writeU8(bc, 1);
|
|
1063
|
+
writeSqliteValueInteger(bc, x.val);
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
case "SqliteValueFloat": {
|
|
1067
|
+
bare.writeU8(bc, 2);
|
|
1068
|
+
writeSqliteValueFloat(bc, x.val);
|
|
1069
|
+
break;
|
|
1070
|
+
}
|
|
1071
|
+
case "SqliteValueText": {
|
|
1072
|
+
bare.writeU8(bc, 3);
|
|
1073
|
+
writeSqliteValueText(bc, x.val);
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
case "SqliteValueBlob": {
|
|
1077
|
+
bare.writeU8(bc, 4);
|
|
1078
|
+
writeSqliteValueBlob(bc, x.val);
|
|
1079
|
+
break;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function readSqliteColumnValue(bc) {
|
|
1084
|
+
const offset = bc.offset;
|
|
1085
|
+
const tag = bare.readU8(bc);
|
|
1086
|
+
switch (tag) {
|
|
1087
|
+
case 0:
|
|
1088
|
+
return { tag: "SqliteValueNull", val: null };
|
|
1089
|
+
case 1:
|
|
1090
|
+
return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
|
|
1091
|
+
case 2:
|
|
1092
|
+
return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
|
|
1093
|
+
case 3:
|
|
1094
|
+
return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
|
|
1095
|
+
case 4:
|
|
1096
|
+
return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
|
|
1097
|
+
default: {
|
|
1098
|
+
bc.offset = offset;
|
|
1099
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
function writeSqliteColumnValue(bc, x) {
|
|
1104
|
+
switch (x.tag) {
|
|
1105
|
+
case "SqliteValueNull": {
|
|
1106
|
+
bare.writeU8(bc, 0);
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
case "SqliteValueInteger": {
|
|
1110
|
+
bare.writeU8(bc, 1);
|
|
1111
|
+
writeSqliteValueInteger(bc, x.val);
|
|
1112
|
+
break;
|
|
1113
|
+
}
|
|
1114
|
+
case "SqliteValueFloat": {
|
|
1115
|
+
bare.writeU8(bc, 2);
|
|
1116
|
+
writeSqliteValueFloat(bc, x.val);
|
|
1117
|
+
break;
|
|
1118
|
+
}
|
|
1119
|
+
case "SqliteValueText": {
|
|
1120
|
+
bare.writeU8(bc, 3);
|
|
1121
|
+
writeSqliteValueText(bc, x.val);
|
|
1122
|
+
break;
|
|
1123
|
+
}
|
|
1124
|
+
case "SqliteValueBlob": {
|
|
1125
|
+
bare.writeU8(bc, 4);
|
|
1126
|
+
writeSqliteValueBlob(bc, x.val);
|
|
1127
|
+
break;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
function read10(bc) {
|
|
1132
|
+
const len = bare.readUintSafe(bc);
|
|
1133
|
+
if (len === 0) {
|
|
1134
|
+
return [];
|
|
1135
|
+
}
|
|
1136
|
+
const result = [bare.readString(bc)];
|
|
1137
|
+
for (let i = 1; i < len; i++) {
|
|
1138
|
+
result[i] = bare.readString(bc);
|
|
1139
|
+
}
|
|
1140
|
+
return result;
|
|
1141
|
+
}
|
|
1142
|
+
function write10(bc, x) {
|
|
1143
|
+
bare.writeUintSafe(bc, x.length);
|
|
1144
|
+
for (let i = 0; i < x.length; i++) {
|
|
1145
|
+
bare.writeString(bc, x[i]);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
function read11(bc) {
|
|
1149
|
+
const len = bare.readUintSafe(bc);
|
|
1150
|
+
if (len === 0) {
|
|
1151
|
+
return [];
|
|
1152
|
+
}
|
|
1153
|
+
const result = [readSqliteColumnValue(bc)];
|
|
1154
|
+
for (let i = 1; i < len; i++) {
|
|
1155
|
+
result[i] = readSqliteColumnValue(bc);
|
|
1156
|
+
}
|
|
1157
|
+
return result;
|
|
1158
|
+
}
|
|
1159
|
+
function write11(bc, x) {
|
|
1160
|
+
bare.writeUintSafe(bc, x.length);
|
|
1161
|
+
for (let i = 0; i < x.length; i++) {
|
|
1162
|
+
writeSqliteColumnValue(bc, x[i]);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
function read12(bc) {
|
|
1166
|
+
const len = bare.readUintSafe(bc);
|
|
1167
|
+
if (len === 0) {
|
|
1168
|
+
return [];
|
|
1169
|
+
}
|
|
1170
|
+
const result = [read11(bc)];
|
|
1171
|
+
for (let i = 1; i < len; i++) {
|
|
1172
|
+
result[i] = read11(bc);
|
|
1173
|
+
}
|
|
1174
|
+
return result;
|
|
1175
|
+
}
|
|
1176
|
+
function write12(bc, x) {
|
|
1177
|
+
bare.writeUintSafe(bc, x.length);
|
|
1178
|
+
for (let i = 0; i < x.length; i++) {
|
|
1179
|
+
write11(bc, x[i]);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
function readSqliteQueryResult(bc) {
|
|
1183
|
+
return {
|
|
1184
|
+
columns: read10(bc),
|
|
1185
|
+
rows: read12(bc)
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
function writeSqliteQueryResult(bc, x) {
|
|
1189
|
+
write10(bc, x.columns);
|
|
1190
|
+
write12(bc, x.rows);
|
|
1191
|
+
}
|
|
1192
|
+
var SqliteExecuteRoute = /* @__PURE__ */ ((SqliteExecuteRoute2) => {
|
|
1193
|
+
SqliteExecuteRoute2["Read"] = "Read";
|
|
1194
|
+
SqliteExecuteRoute2["Write"] = "Write";
|
|
1195
|
+
SqliteExecuteRoute2["WriteFallback"] = "WriteFallback";
|
|
1196
|
+
return SqliteExecuteRoute2;
|
|
1197
|
+
})(SqliteExecuteRoute || {});
|
|
1198
|
+
function readSqliteExecuteRoute(bc) {
|
|
1199
|
+
const offset = bc.offset;
|
|
1200
|
+
const tag = bare.readU8(bc);
|
|
1201
|
+
switch (tag) {
|
|
1202
|
+
case 0:
|
|
1203
|
+
return "Read" /* Read */;
|
|
1204
|
+
case 1:
|
|
1205
|
+
return "Write" /* Write */;
|
|
1206
|
+
case 2:
|
|
1207
|
+
return "WriteFallback" /* WriteFallback */;
|
|
1208
|
+
default: {
|
|
1209
|
+
bc.offset = offset;
|
|
1210
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
function writeSqliteExecuteRoute(bc, x) {
|
|
1215
|
+
switch (x) {
|
|
1216
|
+
case "Read" /* Read */: {
|
|
1217
|
+
bare.writeU8(bc, 0);
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
case "Write" /* Write */: {
|
|
1221
|
+
bare.writeU8(bc, 1);
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
1224
|
+
case "WriteFallback" /* WriteFallback */: {
|
|
1225
|
+
bare.writeU8(bc, 2);
|
|
1226
|
+
break;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function read13(bc) {
|
|
1231
|
+
return bare.readBool(bc) ? bare.readI64(bc) : null;
|
|
1232
|
+
}
|
|
1233
|
+
function write13(bc, x) {
|
|
1234
|
+
bare.writeBool(bc, x != null);
|
|
1235
|
+
if (x != null) {
|
|
1236
|
+
bare.writeI64(bc, x);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function readSqliteExecuteResult(bc) {
|
|
1240
|
+
return {
|
|
1241
|
+
columns: read10(bc),
|
|
1242
|
+
rows: read12(bc),
|
|
1243
|
+
changes: bare.readI64(bc),
|
|
1244
|
+
lastInsertRowId: read13(bc),
|
|
1245
|
+
route: readSqliteExecuteRoute(bc)
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
function writeSqliteExecuteResult(bc, x) {
|
|
1249
|
+
write10(bc, x.columns);
|
|
1250
|
+
write12(bc, x.rows);
|
|
1251
|
+
bare.writeI64(bc, x.changes);
|
|
1252
|
+
write13(bc, x.lastInsertRowId);
|
|
1253
|
+
writeSqliteExecuteRoute(bc, x.route);
|
|
1254
|
+
}
|
|
1255
|
+
function readSqliteExecRequest(bc) {
|
|
1256
|
+
return {
|
|
1257
|
+
namespaceId: readId(bc),
|
|
1258
|
+
actorId: readId(bc),
|
|
1259
|
+
generation: readSqliteGeneration(bc),
|
|
1260
|
+
sql: bare.readString(bc)
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
function writeSqliteExecRequest(bc, x) {
|
|
1264
|
+
writeId(bc, x.namespaceId);
|
|
1265
|
+
writeId(bc, x.actorId);
|
|
1266
|
+
writeSqliteGeneration(bc, x.generation);
|
|
1267
|
+
bare.writeString(bc, x.sql);
|
|
1268
|
+
}
|
|
1269
|
+
function read14(bc) {
|
|
1270
|
+
const len = bare.readUintSafe(bc);
|
|
1271
|
+
if (len === 0) {
|
|
1272
|
+
return [];
|
|
1273
|
+
}
|
|
1274
|
+
const result = [readSqliteBindParam(bc)];
|
|
1275
|
+
for (let i = 1; i < len; i++) {
|
|
1276
|
+
result[i] = readSqliteBindParam(bc);
|
|
1277
|
+
}
|
|
1278
|
+
return result;
|
|
1279
|
+
}
|
|
1280
|
+
function write14(bc, x) {
|
|
1281
|
+
bare.writeUintSafe(bc, x.length);
|
|
1282
|
+
for (let i = 0; i < x.length; i++) {
|
|
1283
|
+
writeSqliteBindParam(bc, x[i]);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
function read15(bc) {
|
|
1287
|
+
return bare.readBool(bc) ? read14(bc) : null;
|
|
1288
|
+
}
|
|
1289
|
+
function write15(bc, x) {
|
|
1290
|
+
bare.writeBool(bc, x != null);
|
|
1291
|
+
if (x != null) {
|
|
1292
|
+
write14(bc, x);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function readSqliteExecuteRequest(bc) {
|
|
1296
|
+
return {
|
|
1297
|
+
namespaceId: readId(bc),
|
|
1298
|
+
actorId: readId(bc),
|
|
1299
|
+
generation: readSqliteGeneration(bc),
|
|
1300
|
+
sql: bare.readString(bc),
|
|
1301
|
+
params: read15(bc)
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
function writeSqliteExecuteRequest(bc, x) {
|
|
1305
|
+
writeId(bc, x.namespaceId);
|
|
1306
|
+
writeId(bc, x.actorId);
|
|
1307
|
+
writeSqliteGeneration(bc, x.generation);
|
|
1308
|
+
bare.writeString(bc, x.sql);
|
|
1309
|
+
write15(bc, x.params);
|
|
1310
|
+
}
|
|
1311
|
+
function readSqliteExecuteWriteRequest(bc) {
|
|
1312
|
+
return {
|
|
1313
|
+
namespaceId: readId(bc),
|
|
1314
|
+
actorId: readId(bc),
|
|
1315
|
+
generation: readSqliteGeneration(bc),
|
|
1316
|
+
sql: bare.readString(bc),
|
|
1317
|
+
params: read15(bc)
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
function writeSqliteExecuteWriteRequest(bc, x) {
|
|
1321
|
+
writeId(bc, x.namespaceId);
|
|
1322
|
+
writeId(bc, x.actorId);
|
|
1323
|
+
writeSqliteGeneration(bc, x.generation);
|
|
1324
|
+
bare.writeString(bc, x.sql);
|
|
1325
|
+
write15(bc, x.params);
|
|
1326
|
+
}
|
|
1327
|
+
function readSqliteExecOk(bc) {
|
|
1328
|
+
return {
|
|
1329
|
+
result: readSqliteQueryResult(bc)
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function writeSqliteExecOk(bc, x) {
|
|
1333
|
+
writeSqliteQueryResult(bc, x.result);
|
|
1334
|
+
}
|
|
1335
|
+
function readSqliteExecuteOk(bc) {
|
|
458
1336
|
return {
|
|
459
|
-
|
|
1337
|
+
result: readSqliteExecuteResult(bc)
|
|
460
1338
|
};
|
|
461
1339
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
1340
|
+
function writeSqliteExecuteOk(bc, x) {
|
|
1341
|
+
writeSqliteExecuteResult(bc, x.result);
|
|
464
1342
|
}
|
|
465
|
-
function
|
|
1343
|
+
function readSqliteExecuteWriteOk(bc) {
|
|
466
1344
|
return {
|
|
467
|
-
|
|
1345
|
+
result: readSqliteExecuteResult(bc)
|
|
468
1346
|
};
|
|
469
1347
|
}
|
|
470
|
-
function
|
|
471
|
-
|
|
1348
|
+
function writeSqliteExecuteWriteOk(bc, x) {
|
|
1349
|
+
writeSqliteExecuteResult(bc, x.result);
|
|
472
1350
|
}
|
|
473
|
-
function
|
|
1351
|
+
function readSqliteExecResponse(bc) {
|
|
474
1352
|
const offset = bc.offset;
|
|
475
1353
|
const tag = bare.readU8(bc);
|
|
476
1354
|
switch (tag) {
|
|
477
1355
|
case 0:
|
|
478
|
-
return { tag: "
|
|
1356
|
+
return { tag: "SqliteExecOk", val: readSqliteExecOk(bc) };
|
|
479
1357
|
case 1:
|
|
1358
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
1359
|
+
case 2:
|
|
480
1360
|
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
481
1361
|
default: {
|
|
482
1362
|
bc.offset = offset;
|
|
@@ -484,62 +1364,69 @@ function readSqliteGetPagesResponse(bc) {
|
|
|
484
1364
|
}
|
|
485
1365
|
}
|
|
486
1366
|
}
|
|
487
|
-
function
|
|
1367
|
+
function writeSqliteExecResponse(bc, x) {
|
|
488
1368
|
switch (x.tag) {
|
|
489
|
-
case "
|
|
1369
|
+
case "SqliteExecOk": {
|
|
490
1370
|
bare.writeU8(bc, 0);
|
|
491
|
-
|
|
1371
|
+
writeSqliteExecOk(bc, x.val);
|
|
492
1372
|
break;
|
|
493
1373
|
}
|
|
494
|
-
case "
|
|
1374
|
+
case "SqliteFenceMismatch": {
|
|
495
1375
|
bare.writeU8(bc, 1);
|
|
1376
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
1377
|
+
break;
|
|
1378
|
+
}
|
|
1379
|
+
case "SqliteErrorResponse": {
|
|
1380
|
+
bare.writeU8(bc, 2);
|
|
496
1381
|
writeSqliteErrorResponse(bc, x.val);
|
|
497
1382
|
break;
|
|
498
1383
|
}
|
|
499
1384
|
}
|
|
500
1385
|
}
|
|
501
|
-
function
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
1386
|
+
function readSqliteExecuteResponse(bc) {
|
|
1387
|
+
const offset = bc.offset;
|
|
1388
|
+
const tag = bare.readU8(bc);
|
|
1389
|
+
switch (tag) {
|
|
1390
|
+
case 0:
|
|
1391
|
+
return { tag: "SqliteExecuteOk", val: readSqliteExecuteOk(bc) };
|
|
1392
|
+
case 1:
|
|
1393
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
1394
|
+
case 2:
|
|
1395
|
+
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
1396
|
+
default: {
|
|
1397
|
+
bc.offset = offset;
|
|
1398
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
1399
|
+
}
|
|
509
1400
|
}
|
|
510
|
-
return result;
|
|
511
1401
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
1402
|
+
function writeSqliteExecuteResponse(bc, x) {
|
|
1403
|
+
switch (x.tag) {
|
|
1404
|
+
case "SqliteExecuteOk": {
|
|
1405
|
+
bare.writeU8(bc, 0);
|
|
1406
|
+
writeSqliteExecuteOk(bc, x.val);
|
|
1407
|
+
break;
|
|
1408
|
+
}
|
|
1409
|
+
case "SqliteFenceMismatch": {
|
|
1410
|
+
bare.writeU8(bc, 1);
|
|
1411
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
case "SqliteErrorResponse": {
|
|
1415
|
+
bare.writeU8(bc, 2);
|
|
1416
|
+
writeSqliteErrorResponse(bc, x.val);
|
|
1417
|
+
break;
|
|
1418
|
+
}
|
|
516
1419
|
}
|
|
517
1420
|
}
|
|
518
|
-
function
|
|
519
|
-
return {
|
|
520
|
-
actorId: readId(bc),
|
|
521
|
-
dirtyPages: read8(bc),
|
|
522
|
-
dbSizePages: bare.readU32(bc),
|
|
523
|
-
nowMs: bare.readI64(bc),
|
|
524
|
-
expectedGeneration: read2(bc),
|
|
525
|
-
expectedHeadTxid: read2(bc)
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
function writeSqliteCommitRequest(bc, x) {
|
|
529
|
-
writeId(bc, x.actorId);
|
|
530
|
-
write8(bc, x.dirtyPages);
|
|
531
|
-
bare.writeU32(bc, x.dbSizePages);
|
|
532
|
-
bare.writeI64(bc, x.nowMs);
|
|
533
|
-
write2(bc, x.expectedGeneration);
|
|
534
|
-
write2(bc, x.expectedHeadTxid);
|
|
535
|
-
}
|
|
536
|
-
function readSqliteCommitResponse(bc) {
|
|
1421
|
+
function readSqliteExecuteWriteResponse(bc) {
|
|
537
1422
|
const offset = bc.offset;
|
|
538
1423
|
const tag = bare.readU8(bc);
|
|
539
1424
|
switch (tag) {
|
|
540
1425
|
case 0:
|
|
541
|
-
return { tag: "
|
|
1426
|
+
return { tag: "SqliteExecuteWriteOk", val: readSqliteExecuteWriteOk(bc) };
|
|
542
1427
|
case 1:
|
|
1428
|
+
return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
|
|
1429
|
+
case 2:
|
|
543
1430
|
return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
|
|
544
1431
|
default: {
|
|
545
1432
|
bc.offset = offset;
|
|
@@ -547,14 +1434,20 @@ function readSqliteCommitResponse(bc) {
|
|
|
547
1434
|
}
|
|
548
1435
|
}
|
|
549
1436
|
}
|
|
550
|
-
function
|
|
1437
|
+
function writeSqliteExecuteWriteResponse(bc, x) {
|
|
551
1438
|
switch (x.tag) {
|
|
552
|
-
case "
|
|
1439
|
+
case "SqliteExecuteWriteOk": {
|
|
553
1440
|
bare.writeU8(bc, 0);
|
|
1441
|
+
writeSqliteExecuteWriteOk(bc, x.val);
|
|
554
1442
|
break;
|
|
555
1443
|
}
|
|
556
|
-
case "
|
|
1444
|
+
case "SqliteFenceMismatch": {
|
|
557
1445
|
bare.writeU8(bc, 1);
|
|
1446
|
+
writeSqliteFenceMismatch(bc, x.val);
|
|
1447
|
+
break;
|
|
1448
|
+
}
|
|
1449
|
+
case "SqliteErrorResponse": {
|
|
1450
|
+
bare.writeU8(bc, 2);
|
|
558
1451
|
writeSqliteErrorResponse(bc, x.val);
|
|
559
1452
|
break;
|
|
560
1453
|
}
|
|
@@ -599,19 +1492,19 @@ function readActorName(bc) {
|
|
|
599
1492
|
function writeActorName(bc, x) {
|
|
600
1493
|
writeJson(bc, x.metadata);
|
|
601
1494
|
}
|
|
602
|
-
function
|
|
1495
|
+
function read16(bc) {
|
|
603
1496
|
return bare.readBool(bc) ? bare.readString(bc) : null;
|
|
604
1497
|
}
|
|
605
|
-
function
|
|
1498
|
+
function write16(bc, x) {
|
|
606
1499
|
bare.writeBool(bc, x != null);
|
|
607
1500
|
if (x != null) {
|
|
608
1501
|
bare.writeString(bc, x);
|
|
609
1502
|
}
|
|
610
1503
|
}
|
|
611
|
-
function
|
|
1504
|
+
function read17(bc) {
|
|
612
1505
|
return bare.readBool(bc) ? bare.readData(bc) : null;
|
|
613
1506
|
}
|
|
614
|
-
function
|
|
1507
|
+
function write17(bc, x) {
|
|
615
1508
|
bare.writeBool(bc, x != null);
|
|
616
1509
|
if (x != null) {
|
|
617
1510
|
bare.writeData(bc, x);
|
|
@@ -620,16 +1513,16 @@ function write10(bc, x) {
|
|
|
620
1513
|
function readActorConfig(bc) {
|
|
621
1514
|
return {
|
|
622
1515
|
name: bare.readString(bc),
|
|
623
|
-
key:
|
|
1516
|
+
key: read16(bc),
|
|
624
1517
|
createTs: bare.readI64(bc),
|
|
625
|
-
input:
|
|
1518
|
+
input: read17(bc)
|
|
626
1519
|
};
|
|
627
1520
|
}
|
|
628
1521
|
function writeActorConfig(bc, x) {
|
|
629
1522
|
bare.writeString(bc, x.name);
|
|
630
|
-
|
|
1523
|
+
write16(bc, x.key);
|
|
631
1524
|
bare.writeI64(bc, x.createTs);
|
|
632
|
-
|
|
1525
|
+
write17(bc, x.input);
|
|
633
1526
|
}
|
|
634
1527
|
function readActorCheckpoint(bc) {
|
|
635
1528
|
return {
|
|
@@ -672,12 +1565,12 @@ function writeActorIntent(bc, x) {
|
|
|
672
1565
|
function readActorStateStopped(bc) {
|
|
673
1566
|
return {
|
|
674
1567
|
code: readStopCode(bc),
|
|
675
|
-
message:
|
|
1568
|
+
message: read16(bc)
|
|
676
1569
|
};
|
|
677
1570
|
}
|
|
678
1571
|
function writeActorStateStopped(bc, x) {
|
|
679
1572
|
writeStopCode(bc, x.code);
|
|
680
|
-
|
|
1573
|
+
write16(bc, x.message);
|
|
681
1574
|
}
|
|
682
1575
|
function readActorState(bc) {
|
|
683
1576
|
const offset = bc.offset;
|
|
@@ -722,22 +1615,13 @@ function readEventActorStateUpdate(bc) {
|
|
|
722
1615
|
function writeEventActorStateUpdate(bc, x) {
|
|
723
1616
|
writeActorState(bc, x.state);
|
|
724
1617
|
}
|
|
725
|
-
function read11(bc) {
|
|
726
|
-
return bare.readBool(bc) ? bare.readI64(bc) : null;
|
|
727
|
-
}
|
|
728
|
-
function write11(bc, x) {
|
|
729
|
-
bare.writeBool(bc, x != null);
|
|
730
|
-
if (x != null) {
|
|
731
|
-
bare.writeI64(bc, x);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
1618
|
function readEventActorSetAlarm(bc) {
|
|
735
1619
|
return {
|
|
736
|
-
alarmTs:
|
|
1620
|
+
alarmTs: read13(bc)
|
|
737
1621
|
};
|
|
738
1622
|
}
|
|
739
1623
|
function writeEventActorSetAlarm(bc, x) {
|
|
740
|
-
|
|
1624
|
+
write13(bc, x.alarmTs);
|
|
741
1625
|
}
|
|
742
1626
|
function readEvent(bc) {
|
|
743
1627
|
const offset = bc.offset;
|
|
@@ -796,7 +1680,7 @@ function writePreloadedKvEntry(bc, x) {
|
|
|
796
1680
|
writeKvValue(bc, x.value);
|
|
797
1681
|
writeKvMetadata(bc, x.metadata);
|
|
798
1682
|
}
|
|
799
|
-
function
|
|
1683
|
+
function read18(bc) {
|
|
800
1684
|
const len = bare.readUintSafe(bc);
|
|
801
1685
|
if (len === 0) {
|
|
802
1686
|
return [];
|
|
@@ -807,7 +1691,7 @@ function read12(bc) {
|
|
|
807
1691
|
}
|
|
808
1692
|
return result;
|
|
809
1693
|
}
|
|
810
|
-
function
|
|
1694
|
+
function write18(bc, x) {
|
|
811
1695
|
bare.writeUintSafe(bc, x.length);
|
|
812
1696
|
for (let i = 0; i < x.length; i++) {
|
|
813
1697
|
writePreloadedKvEntry(bc, x[i]);
|
|
@@ -815,13 +1699,13 @@ function write12(bc, x) {
|
|
|
815
1699
|
}
|
|
816
1700
|
function readPreloadedKv(bc) {
|
|
817
1701
|
return {
|
|
818
|
-
entries:
|
|
1702
|
+
entries: read18(bc),
|
|
819
1703
|
requestedGetKeys: read0(bc),
|
|
820
1704
|
requestedPrefixes: read0(bc)
|
|
821
1705
|
};
|
|
822
1706
|
}
|
|
823
1707
|
function writePreloadedKv(bc, x) {
|
|
824
|
-
|
|
1708
|
+
write18(bc, x.entries);
|
|
825
1709
|
write0(bc, x.requestedGetKeys);
|
|
826
1710
|
write0(bc, x.requestedPrefixes);
|
|
827
1711
|
}
|
|
@@ -835,7 +1719,7 @@ function writeHibernatingRequest(bc, x) {
|
|
|
835
1719
|
writeGatewayId(bc, x.gatewayId);
|
|
836
1720
|
writeRequestId(bc, x.requestId);
|
|
837
1721
|
}
|
|
838
|
-
function
|
|
1722
|
+
function read19(bc) {
|
|
839
1723
|
const len = bare.readUintSafe(bc);
|
|
840
1724
|
if (len === 0) {
|
|
841
1725
|
return [];
|
|
@@ -846,32 +1730,43 @@ function read13(bc) {
|
|
|
846
1730
|
}
|
|
847
1731
|
return result;
|
|
848
1732
|
}
|
|
849
|
-
function
|
|
1733
|
+
function write19(bc, x) {
|
|
850
1734
|
bare.writeUintSafe(bc, x.length);
|
|
851
1735
|
for (let i = 0; i < x.length; i++) {
|
|
852
1736
|
writeHibernatingRequest(bc, x[i]);
|
|
853
1737
|
}
|
|
854
1738
|
}
|
|
855
|
-
function
|
|
1739
|
+
function read20(bc) {
|
|
856
1740
|
return bare.readBool(bc) ? readPreloadedKv(bc) : null;
|
|
857
1741
|
}
|
|
858
|
-
function
|
|
1742
|
+
function write20(bc, x) {
|
|
859
1743
|
bare.writeBool(bc, x != null);
|
|
860
1744
|
if (x != null) {
|
|
861
1745
|
writePreloadedKv(bc, x);
|
|
862
1746
|
}
|
|
863
1747
|
}
|
|
1748
|
+
function read21(bc) {
|
|
1749
|
+
return bare.readBool(bc) ? readSqliteStartupData(bc) : null;
|
|
1750
|
+
}
|
|
1751
|
+
function write21(bc, x) {
|
|
1752
|
+
bare.writeBool(bc, x != null);
|
|
1753
|
+
if (x != null) {
|
|
1754
|
+
writeSqliteStartupData(bc, x);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
864
1757
|
function readCommandStartActor(bc) {
|
|
865
1758
|
return {
|
|
866
1759
|
config: readActorConfig(bc),
|
|
867
|
-
hibernatingRequests:
|
|
868
|
-
preloadedKv:
|
|
1760
|
+
hibernatingRequests: read19(bc),
|
|
1761
|
+
preloadedKv: read20(bc),
|
|
1762
|
+
sqliteStartupData: read21(bc)
|
|
869
1763
|
};
|
|
870
1764
|
}
|
|
871
1765
|
function writeCommandStartActor(bc, x) {
|
|
872
1766
|
writeActorConfig(bc, x.config);
|
|
873
|
-
|
|
874
|
-
|
|
1767
|
+
write19(bc, x.hibernatingRequests);
|
|
1768
|
+
write20(bc, x.preloadedKv);
|
|
1769
|
+
write21(bc, x.sqliteStartupData);
|
|
875
1770
|
}
|
|
876
1771
|
var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
|
|
877
1772
|
StopActorReason2["SleepIntent"] = "SleepIntent";
|
|
@@ -1000,7 +1895,7 @@ function writeActorCommandKeyData(bc, x) {
|
|
|
1000
1895
|
}
|
|
1001
1896
|
}
|
|
1002
1897
|
function encodeActorCommandKeyData(x, config) {
|
|
1003
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
1898
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1004
1899
|
const bc = new bare.ByteCursor(
|
|
1005
1900
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1006
1901
|
fullConfig
|
|
@@ -1009,7 +1904,7 @@ function encodeActorCommandKeyData(x, config) {
|
|
|
1009
1904
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1010
1905
|
}
|
|
1011
1906
|
function decodeActorCommandKeyData(bytes) {
|
|
1012
|
-
const bc = new bare.ByteCursor(bytes,
|
|
1907
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1013
1908
|
const result = readActorCommandKeyData(bc);
|
|
1014
1909
|
if (bc.offset < bc.view.byteLength) {
|
|
1015
1910
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1028,7 +1923,7 @@ function writeMessageId(bc, x) {
|
|
|
1028
1923
|
writeRequestId(bc, x.requestId);
|
|
1029
1924
|
writeMessageIndex(bc, x.messageIndex);
|
|
1030
1925
|
}
|
|
1031
|
-
function
|
|
1926
|
+
function read22(bc) {
|
|
1032
1927
|
const len = bare.readUintSafe(bc);
|
|
1033
1928
|
const result = /* @__PURE__ */ new Map();
|
|
1034
1929
|
for (let i = 0; i < len; i++) {
|
|
@@ -1042,7 +1937,7 @@ function read15(bc) {
|
|
|
1042
1937
|
}
|
|
1043
1938
|
return result;
|
|
1044
1939
|
}
|
|
1045
|
-
function
|
|
1940
|
+
function write22(bc, x) {
|
|
1046
1941
|
bare.writeUintSafe(bc, x.size);
|
|
1047
1942
|
for (const kv of x) {
|
|
1048
1943
|
bare.writeString(bc, kv[0]);
|
|
@@ -1054,8 +1949,8 @@ function readToEnvoyRequestStart(bc) {
|
|
|
1054
1949
|
actorId: readId(bc),
|
|
1055
1950
|
method: bare.readString(bc),
|
|
1056
1951
|
path: bare.readString(bc),
|
|
1057
|
-
headers:
|
|
1058
|
-
body:
|
|
1952
|
+
headers: read22(bc),
|
|
1953
|
+
body: read17(bc),
|
|
1059
1954
|
stream: bare.readBool(bc)
|
|
1060
1955
|
};
|
|
1061
1956
|
}
|
|
@@ -1063,8 +1958,8 @@ function writeToEnvoyRequestStart(bc, x) {
|
|
|
1063
1958
|
writeId(bc, x.actorId);
|
|
1064
1959
|
bare.writeString(bc, x.method);
|
|
1065
1960
|
bare.writeString(bc, x.path);
|
|
1066
|
-
|
|
1067
|
-
|
|
1961
|
+
write22(bc, x.headers);
|
|
1962
|
+
write17(bc, x.body);
|
|
1068
1963
|
bare.writeBool(bc, x.stream);
|
|
1069
1964
|
}
|
|
1070
1965
|
function readToEnvoyRequestChunk(bc) {
|
|
@@ -1080,15 +1975,15 @@ function writeToEnvoyRequestChunk(bc, x) {
|
|
|
1080
1975
|
function readToRivetResponseStart(bc) {
|
|
1081
1976
|
return {
|
|
1082
1977
|
status: bare.readU16(bc),
|
|
1083
|
-
headers:
|
|
1084
|
-
body:
|
|
1978
|
+
headers: read22(bc),
|
|
1979
|
+
body: read17(bc),
|
|
1085
1980
|
stream: bare.readBool(bc)
|
|
1086
1981
|
};
|
|
1087
1982
|
}
|
|
1088
1983
|
function writeToRivetResponseStart(bc, x) {
|
|
1089
1984
|
bare.writeU16(bc, x.status);
|
|
1090
|
-
|
|
1091
|
-
|
|
1985
|
+
write22(bc, x.headers);
|
|
1986
|
+
write17(bc, x.body);
|
|
1092
1987
|
bare.writeBool(bc, x.stream);
|
|
1093
1988
|
}
|
|
1094
1989
|
function readToRivetResponseChunk(bc) {
|
|
@@ -1105,13 +2000,13 @@ function readToEnvoyWebSocketOpen(bc) {
|
|
|
1105
2000
|
return {
|
|
1106
2001
|
actorId: readId(bc),
|
|
1107
2002
|
path: bare.readString(bc),
|
|
1108
|
-
headers:
|
|
2003
|
+
headers: read22(bc)
|
|
1109
2004
|
};
|
|
1110
2005
|
}
|
|
1111
2006
|
function writeToEnvoyWebSocketOpen(bc, x) {
|
|
1112
2007
|
writeId(bc, x.actorId);
|
|
1113
2008
|
bare.writeString(bc, x.path);
|
|
1114
|
-
|
|
2009
|
+
write22(bc, x.headers);
|
|
1115
2010
|
}
|
|
1116
2011
|
function readToEnvoyWebSocketMessage(bc) {
|
|
1117
2012
|
return {
|
|
@@ -1123,10 +2018,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
|
|
|
1123
2018
|
bare.writeData(bc, x.data);
|
|
1124
2019
|
bare.writeBool(bc, x.binary);
|
|
1125
2020
|
}
|
|
1126
|
-
function
|
|
2021
|
+
function read23(bc) {
|
|
1127
2022
|
return bare.readBool(bc) ? bare.readU16(bc) : null;
|
|
1128
2023
|
}
|
|
1129
|
-
function
|
|
2024
|
+
function write23(bc, x) {
|
|
1130
2025
|
bare.writeBool(bc, x != null);
|
|
1131
2026
|
if (x != null) {
|
|
1132
2027
|
bare.writeU16(bc, x);
|
|
@@ -1134,13 +2029,13 @@ function write16(bc, x) {
|
|
|
1134
2029
|
}
|
|
1135
2030
|
function readToEnvoyWebSocketClose(bc) {
|
|
1136
2031
|
return {
|
|
1137
|
-
code:
|
|
1138
|
-
reason:
|
|
2032
|
+
code: read23(bc),
|
|
2033
|
+
reason: read16(bc)
|
|
1139
2034
|
};
|
|
1140
2035
|
}
|
|
1141
2036
|
function writeToEnvoyWebSocketClose(bc, x) {
|
|
1142
|
-
|
|
1143
|
-
|
|
2037
|
+
write23(bc, x.code);
|
|
2038
|
+
write16(bc, x.reason);
|
|
1144
2039
|
}
|
|
1145
2040
|
function readToRivetWebSocketOpen(bc) {
|
|
1146
2041
|
return {
|
|
@@ -1170,14 +2065,14 @@ function writeToRivetWebSocketMessageAck(bc, x) {
|
|
|
1170
2065
|
}
|
|
1171
2066
|
function readToRivetWebSocketClose(bc) {
|
|
1172
2067
|
return {
|
|
1173
|
-
code:
|
|
1174
|
-
reason:
|
|
2068
|
+
code: read23(bc),
|
|
2069
|
+
reason: read16(bc),
|
|
1175
2070
|
hibernate: bare.readBool(bc)
|
|
1176
2071
|
};
|
|
1177
2072
|
}
|
|
1178
2073
|
function writeToRivetWebSocketClose(bc, x) {
|
|
1179
|
-
|
|
1180
|
-
|
|
2074
|
+
write23(bc, x.code);
|
|
2075
|
+
write16(bc, x.reason);
|
|
1181
2076
|
bare.writeBool(bc, x.hibernate);
|
|
1182
2077
|
}
|
|
1183
2078
|
function readToRivetTunnelMessageKind(bc) {
|
|
@@ -1325,7 +2220,7 @@ function readToEnvoyPing(bc) {
|
|
|
1325
2220
|
function writeToEnvoyPing(bc, x) {
|
|
1326
2221
|
bare.writeI64(bc, x.ts);
|
|
1327
2222
|
}
|
|
1328
|
-
function
|
|
2223
|
+
function read24(bc) {
|
|
1329
2224
|
const len = bare.readUintSafe(bc);
|
|
1330
2225
|
const result = /* @__PURE__ */ new Map();
|
|
1331
2226
|
for (let i = 0; i < len; i++) {
|
|
@@ -1339,26 +2234,26 @@ function read17(bc) {
|
|
|
1339
2234
|
}
|
|
1340
2235
|
return result;
|
|
1341
2236
|
}
|
|
1342
|
-
function
|
|
2237
|
+
function write24(bc, x) {
|
|
1343
2238
|
bare.writeUintSafe(bc, x.size);
|
|
1344
2239
|
for (const kv of x) {
|
|
1345
2240
|
bare.writeString(bc, kv[0]);
|
|
1346
2241
|
writeActorName(bc, kv[1]);
|
|
1347
2242
|
}
|
|
1348
2243
|
}
|
|
1349
|
-
function
|
|
1350
|
-
return bare.readBool(bc) ?
|
|
2244
|
+
function read25(bc) {
|
|
2245
|
+
return bare.readBool(bc) ? read24(bc) : null;
|
|
1351
2246
|
}
|
|
1352
|
-
function
|
|
2247
|
+
function write25(bc, x) {
|
|
1353
2248
|
bare.writeBool(bc, x != null);
|
|
1354
2249
|
if (x != null) {
|
|
1355
|
-
|
|
2250
|
+
write24(bc, x);
|
|
1356
2251
|
}
|
|
1357
2252
|
}
|
|
1358
|
-
function
|
|
2253
|
+
function read26(bc) {
|
|
1359
2254
|
return bare.readBool(bc) ? readJson(bc) : null;
|
|
1360
2255
|
}
|
|
1361
|
-
function
|
|
2256
|
+
function write26(bc, x) {
|
|
1362
2257
|
bare.writeBool(bc, x != null);
|
|
1363
2258
|
if (x != null) {
|
|
1364
2259
|
writeJson(bc, x);
|
|
@@ -1366,13 +2261,13 @@ function write19(bc, x) {
|
|
|
1366
2261
|
}
|
|
1367
2262
|
function readToRivetMetadata(bc) {
|
|
1368
2263
|
return {
|
|
1369
|
-
prepopulateActorNames:
|
|
1370
|
-
metadata:
|
|
2264
|
+
prepopulateActorNames: read25(bc),
|
|
2265
|
+
metadata: read26(bc)
|
|
1371
2266
|
};
|
|
1372
2267
|
}
|
|
1373
2268
|
function writeToRivetMetadata(bc, x) {
|
|
1374
|
-
|
|
1375
|
-
|
|
2269
|
+
write25(bc, x.prepopulateActorNames);
|
|
2270
|
+
write26(bc, x.metadata);
|
|
1376
2271
|
}
|
|
1377
2272
|
function readToRivetEvents(bc) {
|
|
1378
2273
|
const len = bare.readUintSafe(bc);
|
|
@@ -1391,7 +2286,7 @@ function writeToRivetEvents(bc, x) {
|
|
|
1391
2286
|
writeEventWrapper(bc, x[i]);
|
|
1392
2287
|
}
|
|
1393
2288
|
}
|
|
1394
|
-
function
|
|
2289
|
+
function read27(bc) {
|
|
1395
2290
|
const len = bare.readUintSafe(bc);
|
|
1396
2291
|
if (len === 0) {
|
|
1397
2292
|
return [];
|
|
@@ -1402,7 +2297,7 @@ function read20(bc) {
|
|
|
1402
2297
|
}
|
|
1403
2298
|
return result;
|
|
1404
2299
|
}
|
|
1405
|
-
function
|
|
2300
|
+
function write27(bc, x) {
|
|
1406
2301
|
bare.writeUintSafe(bc, x.length);
|
|
1407
2302
|
for (let i = 0; i < x.length; i++) {
|
|
1408
2303
|
writeActorCheckpoint(bc, x[i]);
|
|
@@ -1410,11 +2305,11 @@ function write20(bc, x) {
|
|
|
1410
2305
|
}
|
|
1411
2306
|
function readToRivetAckCommands(bc) {
|
|
1412
2307
|
return {
|
|
1413
|
-
lastCommandCheckpoints:
|
|
2308
|
+
lastCommandCheckpoints: read27(bc)
|
|
1414
2309
|
};
|
|
1415
2310
|
}
|
|
1416
2311
|
function writeToRivetAckCommands(bc, x) {
|
|
1417
|
-
|
|
2312
|
+
write27(bc, x.lastCommandCheckpoints);
|
|
1418
2313
|
}
|
|
1419
2314
|
function readToRivetPong(bc) {
|
|
1420
2315
|
return {
|
|
@@ -1446,6 +2341,16 @@ function writeToRivetSqliteGetPagesRequest(bc, x) {
|
|
|
1446
2341
|
bare.writeU32(bc, x.requestId);
|
|
1447
2342
|
writeSqliteGetPagesRequest(bc, x.data);
|
|
1448
2343
|
}
|
|
2344
|
+
function readToRivetSqliteGetPageRangeRequest(bc) {
|
|
2345
|
+
return {
|
|
2346
|
+
requestId: bare.readU32(bc),
|
|
2347
|
+
data: readSqliteGetPageRangeRequest(bc)
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
function writeToRivetSqliteGetPageRangeRequest(bc, x) {
|
|
2351
|
+
bare.writeU32(bc, x.requestId);
|
|
2352
|
+
writeSqliteGetPageRangeRequest(bc, x.data);
|
|
2353
|
+
}
|
|
1449
2354
|
function readToRivetSqliteCommitRequest(bc) {
|
|
1450
2355
|
return {
|
|
1451
2356
|
requestId: bare.readU32(bc),
|
|
@@ -1456,6 +2361,76 @@ function writeToRivetSqliteCommitRequest(bc, x) {
|
|
|
1456
2361
|
bare.writeU32(bc, x.requestId);
|
|
1457
2362
|
writeSqliteCommitRequest(bc, x.data);
|
|
1458
2363
|
}
|
|
2364
|
+
function readToRivetSqliteCommitStageBeginRequest(bc) {
|
|
2365
|
+
return {
|
|
2366
|
+
requestId: bare.readU32(bc),
|
|
2367
|
+
data: readSqliteCommitStageBeginRequest(bc)
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
function writeToRivetSqliteCommitStageBeginRequest(bc, x) {
|
|
2371
|
+
bare.writeU32(bc, x.requestId);
|
|
2372
|
+
writeSqliteCommitStageBeginRequest(bc, x.data);
|
|
2373
|
+
}
|
|
2374
|
+
function readToRivetSqliteCommitStageRequest(bc) {
|
|
2375
|
+
return {
|
|
2376
|
+
requestId: bare.readU32(bc),
|
|
2377
|
+
data: readSqliteCommitStageRequest(bc)
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
function writeToRivetSqliteCommitStageRequest(bc, x) {
|
|
2381
|
+
bare.writeU32(bc, x.requestId);
|
|
2382
|
+
writeSqliteCommitStageRequest(bc, x.data);
|
|
2383
|
+
}
|
|
2384
|
+
function readToRivetSqliteCommitFinalizeRequest(bc) {
|
|
2385
|
+
return {
|
|
2386
|
+
requestId: bare.readU32(bc),
|
|
2387
|
+
data: readSqliteCommitFinalizeRequest(bc)
|
|
2388
|
+
};
|
|
2389
|
+
}
|
|
2390
|
+
function writeToRivetSqliteCommitFinalizeRequest(bc, x) {
|
|
2391
|
+
bare.writeU32(bc, x.requestId);
|
|
2392
|
+
writeSqliteCommitFinalizeRequest(bc, x.data);
|
|
2393
|
+
}
|
|
2394
|
+
function readToRivetSqlitePersistPreloadHintsRequest(bc) {
|
|
2395
|
+
return {
|
|
2396
|
+
requestId: bare.readU32(bc),
|
|
2397
|
+
data: readSqlitePersistPreloadHintsRequest(bc)
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
function writeToRivetSqlitePersistPreloadHintsRequest(bc, x) {
|
|
2401
|
+
bare.writeU32(bc, x.requestId);
|
|
2402
|
+
writeSqlitePersistPreloadHintsRequest(bc, x.data);
|
|
2403
|
+
}
|
|
2404
|
+
function readToRivetSqliteExecRequest(bc) {
|
|
2405
|
+
return {
|
|
2406
|
+
requestId: bare.readU32(bc),
|
|
2407
|
+
data: readSqliteExecRequest(bc)
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
function writeToRivetSqliteExecRequest(bc, x) {
|
|
2411
|
+
bare.writeU32(bc, x.requestId);
|
|
2412
|
+
writeSqliteExecRequest(bc, x.data);
|
|
2413
|
+
}
|
|
2414
|
+
function readToRivetSqliteExecuteRequest(bc) {
|
|
2415
|
+
return {
|
|
2416
|
+
requestId: bare.readU32(bc),
|
|
2417
|
+
data: readSqliteExecuteRequest(bc)
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
function writeToRivetSqliteExecuteRequest(bc, x) {
|
|
2421
|
+
bare.writeU32(bc, x.requestId);
|
|
2422
|
+
writeSqliteExecuteRequest(bc, x.data);
|
|
2423
|
+
}
|
|
2424
|
+
function readToRivetSqliteExecuteWriteRequest(bc) {
|
|
2425
|
+
return {
|
|
2426
|
+
requestId: bare.readU32(bc),
|
|
2427
|
+
data: readSqliteExecuteWriteRequest(bc)
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
function writeToRivetSqliteExecuteWriteRequest(bc, x) {
|
|
2431
|
+
bare.writeU32(bc, x.requestId);
|
|
2432
|
+
writeSqliteExecuteWriteRequest(bc, x.data);
|
|
2433
|
+
}
|
|
1459
2434
|
function readToRivet(bc) {
|
|
1460
2435
|
const offset = bc.offset;
|
|
1461
2436
|
const tag = bare.readU8(bc);
|
|
@@ -1477,7 +2452,23 @@ function readToRivet(bc) {
|
|
|
1477
2452
|
case 7:
|
|
1478
2453
|
return { tag: "ToRivetSqliteGetPagesRequest", val: readToRivetSqliteGetPagesRequest(bc) };
|
|
1479
2454
|
case 8:
|
|
2455
|
+
return { tag: "ToRivetSqliteGetPageRangeRequest", val: readToRivetSqliteGetPageRangeRequest(bc) };
|
|
2456
|
+
case 9:
|
|
1480
2457
|
return { tag: "ToRivetSqliteCommitRequest", val: readToRivetSqliteCommitRequest(bc) };
|
|
2458
|
+
case 10:
|
|
2459
|
+
return { tag: "ToRivetSqliteCommitStageBeginRequest", val: readToRivetSqliteCommitStageBeginRequest(bc) };
|
|
2460
|
+
case 11:
|
|
2461
|
+
return { tag: "ToRivetSqliteCommitStageRequest", val: readToRivetSqliteCommitStageRequest(bc) };
|
|
2462
|
+
case 12:
|
|
2463
|
+
return { tag: "ToRivetSqliteCommitFinalizeRequest", val: readToRivetSqliteCommitFinalizeRequest(bc) };
|
|
2464
|
+
case 13:
|
|
2465
|
+
return { tag: "ToRivetSqlitePersistPreloadHintsRequest", val: readToRivetSqlitePersistPreloadHintsRequest(bc) };
|
|
2466
|
+
case 14:
|
|
2467
|
+
return { tag: "ToRivetSqliteExecRequest", val: readToRivetSqliteExecRequest(bc) };
|
|
2468
|
+
case 15:
|
|
2469
|
+
return { tag: "ToRivetSqliteExecuteRequest", val: readToRivetSqliteExecuteRequest(bc) };
|
|
2470
|
+
case 16:
|
|
2471
|
+
return { tag: "ToRivetSqliteExecuteWriteRequest", val: readToRivetSqliteExecuteWriteRequest(bc) };
|
|
1481
2472
|
default: {
|
|
1482
2473
|
bc.offset = offset;
|
|
1483
2474
|
throw new bare.BareError(offset, "invalid tag");
|
|
@@ -1525,15 +2516,55 @@ function writeToRivet(bc, x) {
|
|
|
1525
2516
|
writeToRivetSqliteGetPagesRequest(bc, x.val);
|
|
1526
2517
|
break;
|
|
1527
2518
|
}
|
|
1528
|
-
case "
|
|
2519
|
+
case "ToRivetSqliteGetPageRangeRequest": {
|
|
1529
2520
|
bare.writeU8(bc, 8);
|
|
2521
|
+
writeToRivetSqliteGetPageRangeRequest(bc, x.val);
|
|
2522
|
+
break;
|
|
2523
|
+
}
|
|
2524
|
+
case "ToRivetSqliteCommitRequest": {
|
|
2525
|
+
bare.writeU8(bc, 9);
|
|
1530
2526
|
writeToRivetSqliteCommitRequest(bc, x.val);
|
|
1531
2527
|
break;
|
|
1532
2528
|
}
|
|
2529
|
+
case "ToRivetSqliteCommitStageBeginRequest": {
|
|
2530
|
+
bare.writeU8(bc, 10);
|
|
2531
|
+
writeToRivetSqliteCommitStageBeginRequest(bc, x.val);
|
|
2532
|
+
break;
|
|
2533
|
+
}
|
|
2534
|
+
case "ToRivetSqliteCommitStageRequest": {
|
|
2535
|
+
bare.writeU8(bc, 11);
|
|
2536
|
+
writeToRivetSqliteCommitStageRequest(bc, x.val);
|
|
2537
|
+
break;
|
|
2538
|
+
}
|
|
2539
|
+
case "ToRivetSqliteCommitFinalizeRequest": {
|
|
2540
|
+
bare.writeU8(bc, 12);
|
|
2541
|
+
writeToRivetSqliteCommitFinalizeRequest(bc, x.val);
|
|
2542
|
+
break;
|
|
2543
|
+
}
|
|
2544
|
+
case "ToRivetSqlitePersistPreloadHintsRequest": {
|
|
2545
|
+
bare.writeU8(bc, 13);
|
|
2546
|
+
writeToRivetSqlitePersistPreloadHintsRequest(bc, x.val);
|
|
2547
|
+
break;
|
|
2548
|
+
}
|
|
2549
|
+
case "ToRivetSqliteExecRequest": {
|
|
2550
|
+
bare.writeU8(bc, 14);
|
|
2551
|
+
writeToRivetSqliteExecRequest(bc, x.val);
|
|
2552
|
+
break;
|
|
2553
|
+
}
|
|
2554
|
+
case "ToRivetSqliteExecuteRequest": {
|
|
2555
|
+
bare.writeU8(bc, 15);
|
|
2556
|
+
writeToRivetSqliteExecuteRequest(bc, x.val);
|
|
2557
|
+
break;
|
|
2558
|
+
}
|
|
2559
|
+
case "ToRivetSqliteExecuteWriteRequest": {
|
|
2560
|
+
bare.writeU8(bc, 16);
|
|
2561
|
+
writeToRivetSqliteExecuteWriteRequest(bc, x.val);
|
|
2562
|
+
break;
|
|
2563
|
+
}
|
|
1533
2564
|
}
|
|
1534
2565
|
}
|
|
1535
2566
|
function encodeToRivet(x, config) {
|
|
1536
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
2567
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1537
2568
|
const bc = new bare.ByteCursor(
|
|
1538
2569
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1539
2570
|
fullConfig
|
|
@@ -1542,7 +2573,7 @@ function encodeToRivet(x, config) {
|
|
|
1542
2573
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1543
2574
|
}
|
|
1544
2575
|
function decodeToRivet(bytes) {
|
|
1545
|
-
const bc = new bare.ByteCursor(bytes,
|
|
2576
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1546
2577
|
const result = readToRivet(bc);
|
|
1547
2578
|
if (bc.offset < bc.view.byteLength) {
|
|
1548
2579
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1588,11 +2619,11 @@ function writeToEnvoyCommands(bc, x) {
|
|
|
1588
2619
|
}
|
|
1589
2620
|
function readToEnvoyAckEvents(bc) {
|
|
1590
2621
|
return {
|
|
1591
|
-
lastEventCheckpoints:
|
|
2622
|
+
lastEventCheckpoints: read27(bc)
|
|
1592
2623
|
};
|
|
1593
2624
|
}
|
|
1594
2625
|
function writeToEnvoyAckEvents(bc, x) {
|
|
1595
|
-
|
|
2626
|
+
write27(bc, x.lastEventCheckpoints);
|
|
1596
2627
|
}
|
|
1597
2628
|
function readToEnvoyKvResponse(bc) {
|
|
1598
2629
|
return {
|
|
@@ -1614,6 +2645,16 @@ function writeToEnvoySqliteGetPagesResponse(bc, x) {
|
|
|
1614
2645
|
bare.writeU32(bc, x.requestId);
|
|
1615
2646
|
writeSqliteGetPagesResponse(bc, x.data);
|
|
1616
2647
|
}
|
|
2648
|
+
function readToEnvoySqliteGetPageRangeResponse(bc) {
|
|
2649
|
+
return {
|
|
2650
|
+
requestId: bare.readU32(bc),
|
|
2651
|
+
data: readSqliteGetPageRangeResponse(bc)
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2654
|
+
function writeToEnvoySqliteGetPageRangeResponse(bc, x) {
|
|
2655
|
+
bare.writeU32(bc, x.requestId);
|
|
2656
|
+
writeSqliteGetPageRangeResponse(bc, x.data);
|
|
2657
|
+
}
|
|
1617
2658
|
function readToEnvoySqliteCommitResponse(bc) {
|
|
1618
2659
|
return {
|
|
1619
2660
|
requestId: bare.readU32(bc),
|
|
@@ -1624,6 +2665,76 @@ function writeToEnvoySqliteCommitResponse(bc, x) {
|
|
|
1624
2665
|
bare.writeU32(bc, x.requestId);
|
|
1625
2666
|
writeSqliteCommitResponse(bc, x.data);
|
|
1626
2667
|
}
|
|
2668
|
+
function readToEnvoySqliteCommitStageBeginResponse(bc) {
|
|
2669
|
+
return {
|
|
2670
|
+
requestId: bare.readU32(bc),
|
|
2671
|
+
data: readSqliteCommitStageBeginResponse(bc)
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
function writeToEnvoySqliteCommitStageBeginResponse(bc, x) {
|
|
2675
|
+
bare.writeU32(bc, x.requestId);
|
|
2676
|
+
writeSqliteCommitStageBeginResponse(bc, x.data);
|
|
2677
|
+
}
|
|
2678
|
+
function readToEnvoySqliteCommitStageResponse(bc) {
|
|
2679
|
+
return {
|
|
2680
|
+
requestId: bare.readU32(bc),
|
|
2681
|
+
data: readSqliteCommitStageResponse(bc)
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
function writeToEnvoySqliteCommitStageResponse(bc, x) {
|
|
2685
|
+
bare.writeU32(bc, x.requestId);
|
|
2686
|
+
writeSqliteCommitStageResponse(bc, x.data);
|
|
2687
|
+
}
|
|
2688
|
+
function readToEnvoySqliteCommitFinalizeResponse(bc) {
|
|
2689
|
+
return {
|
|
2690
|
+
requestId: bare.readU32(bc),
|
|
2691
|
+
data: readSqliteCommitFinalizeResponse(bc)
|
|
2692
|
+
};
|
|
2693
|
+
}
|
|
2694
|
+
function writeToEnvoySqliteCommitFinalizeResponse(bc, x) {
|
|
2695
|
+
bare.writeU32(bc, x.requestId);
|
|
2696
|
+
writeSqliteCommitFinalizeResponse(bc, x.data);
|
|
2697
|
+
}
|
|
2698
|
+
function readToEnvoySqlitePersistPreloadHintsResponse(bc) {
|
|
2699
|
+
return {
|
|
2700
|
+
requestId: bare.readU32(bc),
|
|
2701
|
+
data: readSqlitePersistPreloadHintsResponse(bc)
|
|
2702
|
+
};
|
|
2703
|
+
}
|
|
2704
|
+
function writeToEnvoySqlitePersistPreloadHintsResponse(bc, x) {
|
|
2705
|
+
bare.writeU32(bc, x.requestId);
|
|
2706
|
+
writeSqlitePersistPreloadHintsResponse(bc, x.data);
|
|
2707
|
+
}
|
|
2708
|
+
function readToEnvoySqliteExecResponse(bc) {
|
|
2709
|
+
return {
|
|
2710
|
+
requestId: bare.readU32(bc),
|
|
2711
|
+
data: readSqliteExecResponse(bc)
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
function writeToEnvoySqliteExecResponse(bc, x) {
|
|
2715
|
+
bare.writeU32(bc, x.requestId);
|
|
2716
|
+
writeSqliteExecResponse(bc, x.data);
|
|
2717
|
+
}
|
|
2718
|
+
function readToEnvoySqliteExecuteResponse(bc) {
|
|
2719
|
+
return {
|
|
2720
|
+
requestId: bare.readU32(bc),
|
|
2721
|
+
data: readSqliteExecuteResponse(bc)
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
function writeToEnvoySqliteExecuteResponse(bc, x) {
|
|
2725
|
+
bare.writeU32(bc, x.requestId);
|
|
2726
|
+
writeSqliteExecuteResponse(bc, x.data);
|
|
2727
|
+
}
|
|
2728
|
+
function readToEnvoySqliteExecuteWriteResponse(bc) {
|
|
2729
|
+
return {
|
|
2730
|
+
requestId: bare.readU32(bc),
|
|
2731
|
+
data: readSqliteExecuteWriteResponse(bc)
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
function writeToEnvoySqliteExecuteWriteResponse(bc, x) {
|
|
2735
|
+
bare.writeU32(bc, x.requestId);
|
|
2736
|
+
writeSqliteExecuteWriteResponse(bc, x.data);
|
|
2737
|
+
}
|
|
1627
2738
|
function readToEnvoy(bc) {
|
|
1628
2739
|
const offset = bc.offset;
|
|
1629
2740
|
const tag = bare.readU8(bc);
|
|
@@ -1643,7 +2754,23 @@ function readToEnvoy(bc) {
|
|
|
1643
2754
|
case 6:
|
|
1644
2755
|
return { tag: "ToEnvoySqliteGetPagesResponse", val: readToEnvoySqliteGetPagesResponse(bc) };
|
|
1645
2756
|
case 7:
|
|
2757
|
+
return { tag: "ToEnvoySqliteGetPageRangeResponse", val: readToEnvoySqliteGetPageRangeResponse(bc) };
|
|
2758
|
+
case 8:
|
|
1646
2759
|
return { tag: "ToEnvoySqliteCommitResponse", val: readToEnvoySqliteCommitResponse(bc) };
|
|
2760
|
+
case 9:
|
|
2761
|
+
return { tag: "ToEnvoySqliteCommitStageBeginResponse", val: readToEnvoySqliteCommitStageBeginResponse(bc) };
|
|
2762
|
+
case 10:
|
|
2763
|
+
return { tag: "ToEnvoySqliteCommitStageResponse", val: readToEnvoySqliteCommitStageResponse(bc) };
|
|
2764
|
+
case 11:
|
|
2765
|
+
return { tag: "ToEnvoySqliteCommitFinalizeResponse", val: readToEnvoySqliteCommitFinalizeResponse(bc) };
|
|
2766
|
+
case 12:
|
|
2767
|
+
return { tag: "ToEnvoySqlitePersistPreloadHintsResponse", val: readToEnvoySqlitePersistPreloadHintsResponse(bc) };
|
|
2768
|
+
case 13:
|
|
2769
|
+
return { tag: "ToEnvoySqliteExecResponse", val: readToEnvoySqliteExecResponse(bc) };
|
|
2770
|
+
case 14:
|
|
2771
|
+
return { tag: "ToEnvoySqliteExecuteResponse", val: readToEnvoySqliteExecuteResponse(bc) };
|
|
2772
|
+
case 15:
|
|
2773
|
+
return { tag: "ToEnvoySqliteExecuteWriteResponse", val: readToEnvoySqliteExecuteWriteResponse(bc) };
|
|
1647
2774
|
default: {
|
|
1648
2775
|
bc.offset = offset;
|
|
1649
2776
|
throw new bare.BareError(offset, "invalid tag");
|
|
@@ -1687,15 +2814,55 @@ function writeToEnvoy(bc, x) {
|
|
|
1687
2814
|
writeToEnvoySqliteGetPagesResponse(bc, x.val);
|
|
1688
2815
|
break;
|
|
1689
2816
|
}
|
|
1690
|
-
case "
|
|
2817
|
+
case "ToEnvoySqliteGetPageRangeResponse": {
|
|
1691
2818
|
bare.writeU8(bc, 7);
|
|
2819
|
+
writeToEnvoySqliteGetPageRangeResponse(bc, x.val);
|
|
2820
|
+
break;
|
|
2821
|
+
}
|
|
2822
|
+
case "ToEnvoySqliteCommitResponse": {
|
|
2823
|
+
bare.writeU8(bc, 8);
|
|
1692
2824
|
writeToEnvoySqliteCommitResponse(bc, x.val);
|
|
1693
2825
|
break;
|
|
1694
2826
|
}
|
|
2827
|
+
case "ToEnvoySqliteCommitStageBeginResponse": {
|
|
2828
|
+
bare.writeU8(bc, 9);
|
|
2829
|
+
writeToEnvoySqliteCommitStageBeginResponse(bc, x.val);
|
|
2830
|
+
break;
|
|
2831
|
+
}
|
|
2832
|
+
case "ToEnvoySqliteCommitStageResponse": {
|
|
2833
|
+
bare.writeU8(bc, 10);
|
|
2834
|
+
writeToEnvoySqliteCommitStageResponse(bc, x.val);
|
|
2835
|
+
break;
|
|
2836
|
+
}
|
|
2837
|
+
case "ToEnvoySqliteCommitFinalizeResponse": {
|
|
2838
|
+
bare.writeU8(bc, 11);
|
|
2839
|
+
writeToEnvoySqliteCommitFinalizeResponse(bc, x.val);
|
|
2840
|
+
break;
|
|
2841
|
+
}
|
|
2842
|
+
case "ToEnvoySqlitePersistPreloadHintsResponse": {
|
|
2843
|
+
bare.writeU8(bc, 12);
|
|
2844
|
+
writeToEnvoySqlitePersistPreloadHintsResponse(bc, x.val);
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2847
|
+
case "ToEnvoySqliteExecResponse": {
|
|
2848
|
+
bare.writeU8(bc, 13);
|
|
2849
|
+
writeToEnvoySqliteExecResponse(bc, x.val);
|
|
2850
|
+
break;
|
|
2851
|
+
}
|
|
2852
|
+
case "ToEnvoySqliteExecuteResponse": {
|
|
2853
|
+
bare.writeU8(bc, 14);
|
|
2854
|
+
writeToEnvoySqliteExecuteResponse(bc, x.val);
|
|
2855
|
+
break;
|
|
2856
|
+
}
|
|
2857
|
+
case "ToEnvoySqliteExecuteWriteResponse": {
|
|
2858
|
+
bare.writeU8(bc, 15);
|
|
2859
|
+
writeToEnvoySqliteExecuteWriteResponse(bc, x.val);
|
|
2860
|
+
break;
|
|
2861
|
+
}
|
|
1695
2862
|
}
|
|
1696
2863
|
}
|
|
1697
2864
|
function encodeToEnvoy(x, config) {
|
|
1698
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
2865
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1699
2866
|
const bc = new bare.ByteCursor(
|
|
1700
2867
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1701
2868
|
fullConfig
|
|
@@ -1704,7 +2871,7 @@ function encodeToEnvoy(x, config) {
|
|
|
1704
2871
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1705
2872
|
}
|
|
1706
2873
|
function decodeToEnvoy(bytes) {
|
|
1707
|
-
const bc = new bare.ByteCursor(bytes,
|
|
2874
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1708
2875
|
const result = readToEnvoy(bc);
|
|
1709
2876
|
if (bc.offset < bc.view.byteLength) {
|
|
1710
2877
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1772,7 +2939,7 @@ function writeToEnvoyConn(bc, x) {
|
|
|
1772
2939
|
}
|
|
1773
2940
|
}
|
|
1774
2941
|
function encodeToEnvoyConn(x, config) {
|
|
1775
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
2942
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1776
2943
|
const bc = new bare.ByteCursor(
|
|
1777
2944
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1778
2945
|
fullConfig
|
|
@@ -1781,7 +2948,7 @@ function encodeToEnvoyConn(x, config) {
|
|
|
1781
2948
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1782
2949
|
}
|
|
1783
2950
|
function decodeToEnvoyConn(bytes) {
|
|
1784
|
-
const bc = new bare.ByteCursor(bytes,
|
|
2951
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1785
2952
|
const result = readToEnvoyConn(bc);
|
|
1786
2953
|
if (bc.offset < bc.view.byteLength) {
|
|
1787
2954
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1827,7 +2994,7 @@ function writeToGateway(bc, x) {
|
|
|
1827
2994
|
}
|
|
1828
2995
|
}
|
|
1829
2996
|
function encodeToGateway(x, config) {
|
|
1830
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
2997
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1831
2998
|
const bc = new bare.ByteCursor(
|
|
1832
2999
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1833
3000
|
fullConfig
|
|
@@ -1836,7 +3003,7 @@ function encodeToGateway(x, config) {
|
|
|
1836
3003
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1837
3004
|
}
|
|
1838
3005
|
function decodeToGateway(bytes) {
|
|
1839
|
-
const bc = new bare.ByteCursor(bytes,
|
|
3006
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1840
3007
|
const result = readToGateway(bc);
|
|
1841
3008
|
if (bc.offset < bc.view.byteLength) {
|
|
1842
3009
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1879,7 +3046,7 @@ function writeToOutbound(bc, x) {
|
|
|
1879
3046
|
}
|
|
1880
3047
|
}
|
|
1881
3048
|
function encodeToOutbound(x, config) {
|
|
1882
|
-
const fullConfig = config != null ? bare.Config(config) :
|
|
3049
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
1883
3050
|
const bc = new bare.ByteCursor(
|
|
1884
3051
|
new Uint8Array(fullConfig.initialBufferLength),
|
|
1885
3052
|
fullConfig
|
|
@@ -1888,7 +3055,7 @@ function encodeToOutbound(x, config) {
|
|
|
1888
3055
|
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
1889
3056
|
}
|
|
1890
3057
|
function decodeToOutbound(bytes) {
|
|
1891
|
-
const bc = new bare.ByteCursor(bytes,
|
|
3058
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
1892
3059
|
const result = readToOutbound(bc);
|
|
1893
3060
|
if (bc.offset < bc.view.byteLength) {
|
|
1894
3061
|
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
@@ -1898,8 +3065,9 @@ function decodeToOutbound(bytes) {
|
|
|
1898
3065
|
function assert(condition, message) {
|
|
1899
3066
|
if (!condition) throw new Error(message ?? "Assertion failed");
|
|
1900
3067
|
}
|
|
1901
|
-
var VERSION =
|
|
3068
|
+
var VERSION = 4;
|
|
1902
3069
|
export {
|
|
3070
|
+
SqliteExecuteRoute,
|
|
1903
3071
|
StopActorReason,
|
|
1904
3072
|
StopCode,
|
|
1905
3073
|
VERSION,
|
|
@@ -1957,16 +3125,59 @@ export {
|
|
|
1957
3125
|
readPreloadedKvEntry,
|
|
1958
3126
|
readProtocolMetadata,
|
|
1959
3127
|
readRequestId,
|
|
3128
|
+
readSqliteBindParam,
|
|
3129
|
+
readSqliteColumnValue,
|
|
3130
|
+
readSqliteCommitFinalizeOk,
|
|
3131
|
+
readSqliteCommitFinalizeRequest,
|
|
3132
|
+
readSqliteCommitFinalizeResponse,
|
|
3133
|
+
readSqliteCommitOk,
|
|
1960
3134
|
readSqliteCommitRequest,
|
|
1961
3135
|
readSqliteCommitResponse,
|
|
3136
|
+
readSqliteCommitStageBeginOk,
|
|
3137
|
+
readSqliteCommitStageBeginRequest,
|
|
3138
|
+
readSqliteCommitStageBeginResponse,
|
|
3139
|
+
readSqliteCommitStageOk,
|
|
3140
|
+
readSqliteCommitStageRequest,
|
|
3141
|
+
readSqliteCommitStageResponse,
|
|
3142
|
+
readSqliteCommitTooLarge,
|
|
1962
3143
|
readSqliteDirtyPage,
|
|
1963
3144
|
readSqliteErrorResponse,
|
|
3145
|
+
readSqliteExecOk,
|
|
3146
|
+
readSqliteExecRequest,
|
|
3147
|
+
readSqliteExecResponse,
|
|
3148
|
+
readSqliteExecuteOk,
|
|
3149
|
+
readSqliteExecuteRequest,
|
|
3150
|
+
readSqliteExecuteResponse,
|
|
3151
|
+
readSqliteExecuteResult,
|
|
3152
|
+
readSqliteExecuteRoute,
|
|
3153
|
+
readSqliteExecuteWriteOk,
|
|
3154
|
+
readSqliteExecuteWriteRequest,
|
|
3155
|
+
readSqliteExecuteWriteResponse,
|
|
3156
|
+
readSqliteFenceMismatch,
|
|
1964
3157
|
readSqliteFetchedPage,
|
|
3158
|
+
readSqliteGeneration,
|
|
3159
|
+
readSqliteGetPageRangeOk,
|
|
3160
|
+
readSqliteGetPageRangeRequest,
|
|
3161
|
+
readSqliteGetPageRangeResponse,
|
|
1965
3162
|
readSqliteGetPagesOk,
|
|
1966
3163
|
readSqliteGetPagesRequest,
|
|
1967
3164
|
readSqliteGetPagesResponse,
|
|
3165
|
+
readSqliteMeta,
|
|
1968
3166
|
readSqlitePageBytes,
|
|
3167
|
+
readSqlitePersistPreloadHintsRequest,
|
|
3168
|
+
readSqlitePersistPreloadHintsResponse,
|
|
1969
3169
|
readSqlitePgno,
|
|
3170
|
+
readSqlitePreloadHintRange,
|
|
3171
|
+
readSqlitePreloadHints,
|
|
3172
|
+
readSqliteQueryResult,
|
|
3173
|
+
readSqliteStageId,
|
|
3174
|
+
readSqliteStageNotFound,
|
|
3175
|
+
readSqliteStartupData,
|
|
3176
|
+
readSqliteTxid,
|
|
3177
|
+
readSqliteValueBlob,
|
|
3178
|
+
readSqliteValueFloat,
|
|
3179
|
+
readSqliteValueInteger,
|
|
3180
|
+
readSqliteValueText,
|
|
1970
3181
|
readStopActorReason,
|
|
1971
3182
|
readStopCode,
|
|
1972
3183
|
readToEnvoy,
|
|
@@ -1979,8 +3190,16 @@ export {
|
|
|
1979
3190
|
readToEnvoyPing,
|
|
1980
3191
|
readToEnvoyRequestChunk,
|
|
1981
3192
|
readToEnvoyRequestStart,
|
|
3193
|
+
readToEnvoySqliteCommitFinalizeResponse,
|
|
1982
3194
|
readToEnvoySqliteCommitResponse,
|
|
3195
|
+
readToEnvoySqliteCommitStageBeginResponse,
|
|
3196
|
+
readToEnvoySqliteCommitStageResponse,
|
|
3197
|
+
readToEnvoySqliteExecResponse,
|
|
3198
|
+
readToEnvoySqliteExecuteResponse,
|
|
3199
|
+
readToEnvoySqliteExecuteWriteResponse,
|
|
3200
|
+
readToEnvoySqliteGetPageRangeResponse,
|
|
1983
3201
|
readToEnvoySqliteGetPagesResponse,
|
|
3202
|
+
readToEnvoySqlitePersistPreloadHintsResponse,
|
|
1984
3203
|
readToEnvoyTunnelMessage,
|
|
1985
3204
|
readToEnvoyTunnelMessageKind,
|
|
1986
3205
|
readToEnvoyWebSocketClose,
|
|
@@ -1998,8 +3217,16 @@ export {
|
|
|
1998
3217
|
readToRivetPong,
|
|
1999
3218
|
readToRivetResponseChunk,
|
|
2000
3219
|
readToRivetResponseStart,
|
|
3220
|
+
readToRivetSqliteCommitFinalizeRequest,
|
|
2001
3221
|
readToRivetSqliteCommitRequest,
|
|
3222
|
+
readToRivetSqliteCommitStageBeginRequest,
|
|
3223
|
+
readToRivetSqliteCommitStageRequest,
|
|
3224
|
+
readToRivetSqliteExecRequest,
|
|
3225
|
+
readToRivetSqliteExecuteRequest,
|
|
3226
|
+
readToRivetSqliteExecuteWriteRequest,
|
|
3227
|
+
readToRivetSqliteGetPageRangeRequest,
|
|
2002
3228
|
readToRivetSqliteGetPagesRequest,
|
|
3229
|
+
readToRivetSqlitePersistPreloadHintsRequest,
|
|
2003
3230
|
readToRivetTunnelMessage,
|
|
2004
3231
|
readToRivetTunnelMessageKind,
|
|
2005
3232
|
readToRivetWebSocketClose,
|
|
@@ -2048,16 +3275,59 @@ export {
|
|
|
2048
3275
|
writePreloadedKvEntry,
|
|
2049
3276
|
writeProtocolMetadata,
|
|
2050
3277
|
writeRequestId,
|
|
3278
|
+
writeSqliteBindParam,
|
|
3279
|
+
writeSqliteColumnValue,
|
|
3280
|
+
writeSqliteCommitFinalizeOk,
|
|
3281
|
+
writeSqliteCommitFinalizeRequest,
|
|
3282
|
+
writeSqliteCommitFinalizeResponse,
|
|
3283
|
+
writeSqliteCommitOk,
|
|
2051
3284
|
writeSqliteCommitRequest,
|
|
2052
3285
|
writeSqliteCommitResponse,
|
|
3286
|
+
writeSqliteCommitStageBeginOk,
|
|
3287
|
+
writeSqliteCommitStageBeginRequest,
|
|
3288
|
+
writeSqliteCommitStageBeginResponse,
|
|
3289
|
+
writeSqliteCommitStageOk,
|
|
3290
|
+
writeSqliteCommitStageRequest,
|
|
3291
|
+
writeSqliteCommitStageResponse,
|
|
3292
|
+
writeSqliteCommitTooLarge,
|
|
2053
3293
|
writeSqliteDirtyPage,
|
|
2054
3294
|
writeSqliteErrorResponse,
|
|
3295
|
+
writeSqliteExecOk,
|
|
3296
|
+
writeSqliteExecRequest,
|
|
3297
|
+
writeSqliteExecResponse,
|
|
3298
|
+
writeSqliteExecuteOk,
|
|
3299
|
+
writeSqliteExecuteRequest,
|
|
3300
|
+
writeSqliteExecuteResponse,
|
|
3301
|
+
writeSqliteExecuteResult,
|
|
3302
|
+
writeSqliteExecuteRoute,
|
|
3303
|
+
writeSqliteExecuteWriteOk,
|
|
3304
|
+
writeSqliteExecuteWriteRequest,
|
|
3305
|
+
writeSqliteExecuteWriteResponse,
|
|
3306
|
+
writeSqliteFenceMismatch,
|
|
2055
3307
|
writeSqliteFetchedPage,
|
|
3308
|
+
writeSqliteGeneration,
|
|
3309
|
+
writeSqliteGetPageRangeOk,
|
|
3310
|
+
writeSqliteGetPageRangeRequest,
|
|
3311
|
+
writeSqliteGetPageRangeResponse,
|
|
2056
3312
|
writeSqliteGetPagesOk,
|
|
2057
3313
|
writeSqliteGetPagesRequest,
|
|
2058
3314
|
writeSqliteGetPagesResponse,
|
|
3315
|
+
writeSqliteMeta,
|
|
2059
3316
|
writeSqlitePageBytes,
|
|
3317
|
+
writeSqlitePersistPreloadHintsRequest,
|
|
3318
|
+
writeSqlitePersistPreloadHintsResponse,
|
|
2060
3319
|
writeSqlitePgno,
|
|
3320
|
+
writeSqlitePreloadHintRange,
|
|
3321
|
+
writeSqlitePreloadHints,
|
|
3322
|
+
writeSqliteQueryResult,
|
|
3323
|
+
writeSqliteStageId,
|
|
3324
|
+
writeSqliteStageNotFound,
|
|
3325
|
+
writeSqliteStartupData,
|
|
3326
|
+
writeSqliteTxid,
|
|
3327
|
+
writeSqliteValueBlob,
|
|
3328
|
+
writeSqliteValueFloat,
|
|
3329
|
+
writeSqliteValueInteger,
|
|
3330
|
+
writeSqliteValueText,
|
|
2061
3331
|
writeStopActorReason,
|
|
2062
3332
|
writeStopCode,
|
|
2063
3333
|
writeToEnvoy,
|
|
@@ -2070,8 +3340,16 @@ export {
|
|
|
2070
3340
|
writeToEnvoyPing,
|
|
2071
3341
|
writeToEnvoyRequestChunk,
|
|
2072
3342
|
writeToEnvoyRequestStart,
|
|
3343
|
+
writeToEnvoySqliteCommitFinalizeResponse,
|
|
2073
3344
|
writeToEnvoySqliteCommitResponse,
|
|
3345
|
+
writeToEnvoySqliteCommitStageBeginResponse,
|
|
3346
|
+
writeToEnvoySqliteCommitStageResponse,
|
|
3347
|
+
writeToEnvoySqliteExecResponse,
|
|
3348
|
+
writeToEnvoySqliteExecuteResponse,
|
|
3349
|
+
writeToEnvoySqliteExecuteWriteResponse,
|
|
3350
|
+
writeToEnvoySqliteGetPageRangeResponse,
|
|
2074
3351
|
writeToEnvoySqliteGetPagesResponse,
|
|
3352
|
+
writeToEnvoySqlitePersistPreloadHintsResponse,
|
|
2075
3353
|
writeToEnvoyTunnelMessage,
|
|
2076
3354
|
writeToEnvoyTunnelMessageKind,
|
|
2077
3355
|
writeToEnvoyWebSocketClose,
|
|
@@ -2089,8 +3367,16 @@ export {
|
|
|
2089
3367
|
writeToRivetPong,
|
|
2090
3368
|
writeToRivetResponseChunk,
|
|
2091
3369
|
writeToRivetResponseStart,
|
|
3370
|
+
writeToRivetSqliteCommitFinalizeRequest,
|
|
2092
3371
|
writeToRivetSqliteCommitRequest,
|
|
3372
|
+
writeToRivetSqliteCommitStageBeginRequest,
|
|
3373
|
+
writeToRivetSqliteCommitStageRequest,
|
|
3374
|
+
writeToRivetSqliteExecRequest,
|
|
3375
|
+
writeToRivetSqliteExecuteRequest,
|
|
3376
|
+
writeToRivetSqliteExecuteWriteRequest,
|
|
3377
|
+
writeToRivetSqliteGetPageRangeRequest,
|
|
2093
3378
|
writeToRivetSqliteGetPagesRequest,
|
|
3379
|
+
writeToRivetSqlitePersistPreloadHintsRequest,
|
|
2094
3380
|
writeToRivetTunnelMessage,
|
|
2095
3381
|
writeToRivetTunnelMessageKind,
|
|
2096
3382
|
writeToRivetWebSocketClose,
|