@rivetkit/engine-envoy-protocol 0.0.0-main.41efcce → 0.0.0-main.49693dc

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 (3) hide show
  1. package/dist/index.d.ts +179 -163
  2. package/dist/index.js +516 -364
  3. package/package.json +6 -1
package/dist/index.js CHANGED
@@ -366,28 +366,16 @@ function writeKvResponseData(bc, x) {
366
366
  }
367
367
  }
368
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
- }
381
369
  function readSqlitePgno(bc) {
382
370
  return bare.readU32(bc);
383
371
  }
384
372
  function writeSqlitePgno(bc, x) {
385
373
  bare.writeU32(bc, x);
386
374
  }
387
- function readSqliteStageId(bc) {
375
+ function readSqliteGeneration(bc) {
388
376
  return bare.readU64(bc);
389
377
  }
390
- function writeSqliteStageId(bc, x) {
378
+ function writeSqliteGeneration(bc, x) {
391
379
  bare.writeU64(bc, x);
392
380
  }
393
381
  function readSqlitePageBytes(bc) {
@@ -396,36 +384,6 @@ function readSqlitePageBytes(bc) {
396
384
  function writeSqlitePageBytes(bc, x) {
397
385
  bare.writeData(bc, x);
398
386
  }
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
- }
429
387
  function readSqliteDirtyPage(bc) {
430
388
  return {
431
389
  pgno: readSqlitePgno(bc),
@@ -475,14 +433,16 @@ function write6(bc, x) {
475
433
  function readSqliteGetPagesRequest(bc) {
476
434
  return {
477
435
  actorId: readId(bc),
478
- generation: readSqliteGeneration(bc),
479
- pgnos: read6(bc)
436
+ pgnos: read6(bc),
437
+ expectedGeneration: read2(bc),
438
+ expectedHeadTxid: read2(bc)
480
439
  };
481
440
  }
482
441
  function writeSqliteGetPagesRequest(bc, x) {
483
442
  writeId(bc, x.actorId);
484
- writeSqliteGeneration(bc, x.generation);
485
443
  write6(bc, x.pgnos);
444
+ write2(bc, x.expectedGeneration);
445
+ write2(bc, x.expectedHeadTxid);
486
446
  }
487
447
  function read7(bc) {
488
448
  const len = bare.readUintSafe(bc);
@@ -504,19 +464,23 @@ function write7(bc, x) {
504
464
  function readSqliteGetPagesOk(bc) {
505
465
  return {
506
466
  pages: read7(bc),
507
- meta: readSqliteMeta(bc)
467
+ headTxid: read2(bc)
508
468
  };
509
469
  }
510
470
  function writeSqliteGetPagesOk(bc, x) {
511
471
  write7(bc, x.pages);
512
- writeSqliteMeta(bc, x.meta);
472
+ write2(bc, x.headTxid);
513
473
  }
514
474
  function readSqliteErrorResponse(bc) {
515
475
  return {
476
+ group: bare.readString(bc),
477
+ code: bare.readString(bc),
516
478
  message: bare.readString(bc)
517
479
  };
518
480
  }
519
481
  function writeSqliteErrorResponse(bc, x) {
482
+ bare.writeString(bc, x.group);
483
+ bare.writeString(bc, x.code);
520
484
  bare.writeString(bc, x.message);
521
485
  }
522
486
  function readSqliteGetPagesResponse(bc) {
@@ -526,8 +490,6 @@ function readSqliteGetPagesResponse(bc) {
526
490
  case 0:
527
491
  return { tag: "SqliteGetPagesOk", val: readSqliteGetPagesOk(bc) };
528
492
  case 1:
529
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
530
- case 2:
531
493
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
532
494
  default: {
533
495
  bc.offset = offset;
@@ -542,13 +504,8 @@ function writeSqliteGetPagesResponse(bc, x) {
542
504
  writeSqliteGetPagesOk(bc, x.val);
543
505
  break;
544
506
  }
545
- case "SqliteFenceMismatch": {
546
- bare.writeU8(bc, 1);
547
- writeSqliteFenceMismatch(bc, x.val);
548
- break;
549
- }
550
507
  case "SqliteErrorResponse": {
551
- bare.writeU8(bc, 2);
508
+ bare.writeU8(bc, 1);
552
509
  writeSqliteErrorResponse(bc, x.val);
553
510
  break;
554
511
  }
@@ -574,38 +531,28 @@ function write8(bc, x) {
574
531
  function readSqliteCommitRequest(bc) {
575
532
  return {
576
533
  actorId: readId(bc),
577
- generation: readSqliteGeneration(bc),
578
- expectedHeadTxid: readSqliteTxid(bc),
579
534
  dirtyPages: read8(bc),
580
- newDbSizePages: bare.readU32(bc)
535
+ dbSizePages: bare.readU32(bc),
536
+ nowMs: bare.readI64(bc),
537
+ expectedGeneration: read2(bc),
538
+ expectedHeadTxid: read2(bc)
581
539
  };
582
540
  }
583
541
  function writeSqliteCommitRequest(bc, x) {
584
542
  writeId(bc, x.actorId);
585
- writeSqliteGeneration(bc, x.generation);
586
- writeSqliteTxid(bc, x.expectedHeadTxid);
587
543
  write8(bc, x.dirtyPages);
588
- bare.writeU32(bc, x.newDbSizePages);
544
+ bare.writeU32(bc, x.dbSizePages);
545
+ bare.writeI64(bc, x.nowMs);
546
+ write2(bc, x.expectedGeneration);
547
+ write2(bc, x.expectedHeadTxid);
589
548
  }
590
549
  function readSqliteCommitOk(bc) {
591
550
  return {
592
- newHeadTxid: readSqliteTxid(bc),
593
- meta: readSqliteMeta(bc)
551
+ headTxid: read2(bc)
594
552
  };
595
553
  }
596
554
  function writeSqliteCommitOk(bc, x) {
597
- writeSqliteTxid(bc, x.newHeadTxid);
598
- writeSqliteMeta(bc, x.meta);
599
- }
600
- function readSqliteCommitTooLarge(bc) {
601
- return {
602
- actualSizeBytes: bare.readU64(bc),
603
- maxSizeBytes: bare.readU64(bc)
604
- };
605
- }
606
- function writeSqliteCommitTooLarge(bc, x) {
607
- bare.writeU64(bc, x.actualSizeBytes);
608
- bare.writeU64(bc, x.maxSizeBytes);
555
+ write2(bc, x.headTxid);
609
556
  }
610
557
  function readSqliteCommitResponse(bc) {
611
558
  const offset = bc.offset;
@@ -614,10 +561,6 @@ function readSqliteCommitResponse(bc) {
614
561
  case 0:
615
562
  return { tag: "SqliteCommitOk", val: readSqliteCommitOk(bc) };
616
563
  case 1:
617
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
618
- case 2:
619
- return { tag: "SqliteCommitTooLarge", val: readSqliteCommitTooLarge(bc) };
620
- case 3:
621
564
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
622
565
  default: {
623
566
  bc.offset = offset;
@@ -632,182 +575,373 @@ function writeSqliteCommitResponse(bc, x) {
632
575
  writeSqliteCommitOk(bc, x.val);
633
576
  break;
634
577
  }
635
- case "SqliteFenceMismatch": {
636
- bare.writeU8(bc, 1);
637
- writeSqliteFenceMismatch(bc, x.val);
638
- break;
639
- }
640
- case "SqliteCommitTooLarge": {
641
- bare.writeU8(bc, 2);
642
- writeSqliteCommitTooLarge(bc, x.val);
643
- break;
644
- }
645
578
  case "SqliteErrorResponse": {
646
- bare.writeU8(bc, 3);
579
+ bare.writeU8(bc, 1);
647
580
  writeSqliteErrorResponse(bc, x.val);
648
581
  break;
649
582
  }
650
583
  }
651
584
  }
652
- function readSqliteCommitStageBeginRequest(bc) {
585
+ function readSqliteValueInteger(bc) {
653
586
  return {
654
- actorId: readId(bc),
655
- generation: readSqliteGeneration(bc)
587
+ value: bare.readI64(bc)
656
588
  };
657
589
  }
658
- function writeSqliteCommitStageBeginRequest(bc, x) {
659
- writeId(bc, x.actorId);
660
- writeSqliteGeneration(bc, x.generation);
590
+ function writeSqliteValueInteger(bc, x) {
591
+ bare.writeI64(bc, x.value);
661
592
  }
662
- function readSqliteCommitStageBeginOk(bc) {
593
+ function readSqliteValueFloat(bc) {
663
594
  return {
664
- txid: readSqliteTxid(bc)
595
+ value: bare.readFixedData(bc, 8)
665
596
  };
666
597
  }
667
- function writeSqliteCommitStageBeginOk(bc, x) {
668
- writeSqliteTxid(bc, x.txid);
598
+ function writeSqliteValueFloat(bc, x) {
599
+ {
600
+ assert(x.value.byteLength === 8);
601
+ bare.writeFixedData(bc, x.value);
602
+ }
603
+ }
604
+ function readSqliteValueText(bc) {
605
+ return {
606
+ value: bare.readString(bc)
607
+ };
608
+ }
609
+ function writeSqliteValueText(bc, x) {
610
+ bare.writeString(bc, x.value);
669
611
  }
670
- function readSqliteCommitStageBeginResponse(bc) {
612
+ function readSqliteValueBlob(bc) {
613
+ return {
614
+ value: bare.readData(bc)
615
+ };
616
+ }
617
+ function writeSqliteValueBlob(bc, x) {
618
+ bare.writeData(bc, x.value);
619
+ }
620
+ function readSqliteBindParam(bc) {
671
621
  const offset = bc.offset;
672
622
  const tag = bare.readU8(bc);
673
623
  switch (tag) {
674
624
  case 0:
675
- return { tag: "SqliteCommitStageBeginOk", val: readSqliteCommitStageBeginOk(bc) };
625
+ return { tag: "SqliteValueNull", val: null };
676
626
  case 1:
677
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
627
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
678
628
  case 2:
679
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
629
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
630
+ case 3:
631
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
632
+ case 4:
633
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
680
634
  default: {
681
635
  bc.offset = offset;
682
636
  throw new bare.BareError(offset, "invalid tag");
683
637
  }
684
638
  }
685
639
  }
686
- function writeSqliteCommitStageBeginResponse(bc, x) {
640
+ function writeSqliteBindParam(bc, x) {
687
641
  switch (x.tag) {
688
- case "SqliteCommitStageBeginOk": {
642
+ case "SqliteValueNull": {
689
643
  bare.writeU8(bc, 0);
690
- writeSqliteCommitStageBeginOk(bc, x.val);
691
644
  break;
692
645
  }
693
- case "SqliteFenceMismatch": {
646
+ case "SqliteValueInteger": {
694
647
  bare.writeU8(bc, 1);
695
- writeSqliteFenceMismatch(bc, x.val);
648
+ writeSqliteValueInteger(bc, x.val);
696
649
  break;
697
650
  }
698
- case "SqliteErrorResponse": {
651
+ case "SqliteValueFloat": {
699
652
  bare.writeU8(bc, 2);
700
- writeSqliteErrorResponse(bc, x.val);
653
+ writeSqliteValueFloat(bc, x.val);
654
+ break;
655
+ }
656
+ case "SqliteValueText": {
657
+ bare.writeU8(bc, 3);
658
+ writeSqliteValueText(bc, x.val);
659
+ break;
660
+ }
661
+ case "SqliteValueBlob": {
662
+ bare.writeU8(bc, 4);
663
+ writeSqliteValueBlob(bc, x.val);
701
664
  break;
702
665
  }
703
666
  }
704
667
  }
705
- function readSqliteCommitStageRequest(bc) {
706
- return {
707
- actorId: readId(bc),
708
- generation: readSqliteGeneration(bc),
709
- txid: readSqliteTxid(bc),
710
- chunkIdx: bare.readU32(bc),
711
- bytes: bare.readData(bc),
712
- isLast: bare.readBool(bc)
713
- };
714
- }
715
- function writeSqliteCommitStageRequest(bc, x) {
716
- writeId(bc, x.actorId);
717
- writeSqliteGeneration(bc, x.generation);
718
- writeSqliteTxid(bc, x.txid);
719
- bare.writeU32(bc, x.chunkIdx);
720
- bare.writeData(bc, x.bytes);
721
- bare.writeBool(bc, x.isLast);
722
- }
723
- function readSqliteCommitStageOk(bc) {
724
- return {
725
- chunkIdxCommitted: bare.readU32(bc)
726
- };
727
- }
728
- function writeSqliteCommitStageOk(bc, x) {
729
- bare.writeU32(bc, x.chunkIdxCommitted);
730
- }
731
- function readSqliteCommitStageResponse(bc) {
668
+ function readSqliteColumnValue(bc) {
732
669
  const offset = bc.offset;
733
670
  const tag = bare.readU8(bc);
734
671
  switch (tag) {
735
672
  case 0:
736
- return { tag: "SqliteCommitStageOk", val: readSqliteCommitStageOk(bc) };
673
+ return { tag: "SqliteValueNull", val: null };
737
674
  case 1:
738
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
675
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
739
676
  case 2:
740
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
677
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
678
+ case 3:
679
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
680
+ case 4:
681
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
741
682
  default: {
742
683
  bc.offset = offset;
743
684
  throw new bare.BareError(offset, "invalid tag");
744
685
  }
745
686
  }
746
687
  }
747
- function writeSqliteCommitStageResponse(bc, x) {
688
+ function writeSqliteColumnValue(bc, x) {
748
689
  switch (x.tag) {
749
- case "SqliteCommitStageOk": {
690
+ case "SqliteValueNull": {
750
691
  bare.writeU8(bc, 0);
751
- writeSqliteCommitStageOk(bc, x.val);
752
692
  break;
753
693
  }
754
- case "SqliteFenceMismatch": {
694
+ case "SqliteValueInteger": {
755
695
  bare.writeU8(bc, 1);
756
- writeSqliteFenceMismatch(bc, x.val);
696
+ writeSqliteValueInteger(bc, x.val);
757
697
  break;
758
698
  }
759
- case "SqliteErrorResponse": {
699
+ case "SqliteValueFloat": {
760
700
  bare.writeU8(bc, 2);
761
- writeSqliteErrorResponse(bc, x.val);
701
+ writeSqliteValueFloat(bc, x.val);
762
702
  break;
763
703
  }
704
+ case "SqliteValueText": {
705
+ bare.writeU8(bc, 3);
706
+ writeSqliteValueText(bc, x.val);
707
+ break;
708
+ }
709
+ case "SqliteValueBlob": {
710
+ bare.writeU8(bc, 4);
711
+ writeSqliteValueBlob(bc, x.val);
712
+ break;
713
+ }
714
+ }
715
+ }
716
+ function read9(bc) {
717
+ const len = bare.readUintSafe(bc);
718
+ if (len === 0) {
719
+ return [];
720
+ }
721
+ const result = [bare.readString(bc)];
722
+ for (let i = 1; i < len; i++) {
723
+ result[i] = bare.readString(bc);
724
+ }
725
+ return result;
726
+ }
727
+ function write9(bc, x) {
728
+ bare.writeUintSafe(bc, x.length);
729
+ for (let i = 0; i < x.length; i++) {
730
+ bare.writeString(bc, x[i]);
731
+ }
732
+ }
733
+ function read10(bc) {
734
+ const len = bare.readUintSafe(bc);
735
+ if (len === 0) {
736
+ return [];
737
+ }
738
+ const result = [readSqliteColumnValue(bc)];
739
+ for (let i = 1; i < len; i++) {
740
+ result[i] = readSqliteColumnValue(bc);
741
+ }
742
+ return result;
743
+ }
744
+ function write10(bc, x) {
745
+ bare.writeUintSafe(bc, x.length);
746
+ for (let i = 0; i < x.length; i++) {
747
+ writeSqliteColumnValue(bc, x[i]);
748
+ }
749
+ }
750
+ function read11(bc) {
751
+ const len = bare.readUintSafe(bc);
752
+ if (len === 0) {
753
+ return [];
754
+ }
755
+ const result = [read10(bc)];
756
+ for (let i = 1; i < len; i++) {
757
+ result[i] = read10(bc);
758
+ }
759
+ return result;
760
+ }
761
+ function write11(bc, x) {
762
+ bare.writeUintSafe(bc, x.length);
763
+ for (let i = 0; i < x.length; i++) {
764
+ write10(bc, x[i]);
765
+ }
766
+ }
767
+ function readSqliteQueryResult(bc) {
768
+ return {
769
+ columns: read9(bc),
770
+ rows: read11(bc)
771
+ };
772
+ }
773
+ function writeSqliteQueryResult(bc, x) {
774
+ write9(bc, x.columns);
775
+ write11(bc, x.rows);
776
+ }
777
+ function read12(bc) {
778
+ return bare.readBool(bc) ? bare.readI64(bc) : null;
779
+ }
780
+ function write12(bc, x) {
781
+ bare.writeBool(bc, x != null);
782
+ if (x != null) {
783
+ bare.writeI64(bc, x);
784
+ }
785
+ }
786
+ function readSqliteExecuteResult(bc) {
787
+ return {
788
+ columns: read9(bc),
789
+ rows: read11(bc),
790
+ changes: bare.readI64(bc),
791
+ lastInsertRowId: read12(bc)
792
+ };
793
+ }
794
+ function writeSqliteExecuteResult(bc, x) {
795
+ write9(bc, x.columns);
796
+ write11(bc, x.rows);
797
+ bare.writeI64(bc, x.changes);
798
+ write12(bc, x.lastInsertRowId);
799
+ }
800
+ function readSqliteExecRequest(bc) {
801
+ return {
802
+ namespaceId: readId(bc),
803
+ actorId: readId(bc),
804
+ generation: readSqliteGeneration(bc),
805
+ sql: bare.readString(bc)
806
+ };
807
+ }
808
+ function writeSqliteExecRequest(bc, x) {
809
+ writeId(bc, x.namespaceId);
810
+ writeId(bc, x.actorId);
811
+ writeSqliteGeneration(bc, x.generation);
812
+ bare.writeString(bc, x.sql);
813
+ }
814
+ function read13(bc) {
815
+ const len = bare.readUintSafe(bc);
816
+ if (len === 0) {
817
+ return [];
818
+ }
819
+ const result = [readSqliteBindParam(bc)];
820
+ for (let i = 1; i < len; i++) {
821
+ result[i] = readSqliteBindParam(bc);
822
+ }
823
+ return result;
824
+ }
825
+ function write13(bc, x) {
826
+ bare.writeUintSafe(bc, x.length);
827
+ for (let i = 0; i < x.length; i++) {
828
+ writeSqliteBindParam(bc, x[i]);
829
+ }
830
+ }
831
+ function read14(bc) {
832
+ return bare.readBool(bc) ? read13(bc) : null;
833
+ }
834
+ function write14(bc, x) {
835
+ bare.writeBool(bc, x != null);
836
+ if (x != null) {
837
+ write13(bc, x);
764
838
  }
765
839
  }
766
- function readSqliteCommitFinalizeRequest(bc) {
840
+ function readSqliteExecuteRequest(bc) {
767
841
  return {
842
+ namespaceId: readId(bc),
768
843
  actorId: readId(bc),
769
844
  generation: readSqliteGeneration(bc),
770
- expectedHeadTxid: readSqliteTxid(bc),
771
- txid: readSqliteTxid(bc),
772
- newDbSizePages: bare.readU32(bc)
845
+ sql: bare.readString(bc),
846
+ params: read14(bc)
773
847
  };
774
848
  }
775
- function writeSqliteCommitFinalizeRequest(bc, x) {
849
+ function writeSqliteExecuteRequest(bc, x) {
850
+ writeId(bc, x.namespaceId);
776
851
  writeId(bc, x.actorId);
777
852
  writeSqliteGeneration(bc, x.generation);
778
- writeSqliteTxid(bc, x.expectedHeadTxid);
779
- writeSqliteTxid(bc, x.txid);
780
- bare.writeU32(bc, x.newDbSizePages);
853
+ bare.writeString(bc, x.sql);
854
+ write14(bc, x.params);
781
855
  }
782
- function readSqliteCommitFinalizeOk(bc) {
856
+ function readSqliteBatchStatement(bc) {
783
857
  return {
784
- newHeadTxid: readSqliteTxid(bc),
785
- meta: readSqliteMeta(bc)
858
+ sql: bare.readString(bc),
859
+ params: read14(bc)
786
860
  };
787
861
  }
788
- function writeSqliteCommitFinalizeOk(bc, x) {
789
- writeSqliteTxid(bc, x.newHeadTxid);
790
- writeSqliteMeta(bc, x.meta);
862
+ function writeSqliteBatchStatement(bc, x) {
863
+ bare.writeString(bc, x.sql);
864
+ write14(bc, x.params);
865
+ }
866
+ function read15(bc) {
867
+ const len = bare.readUintSafe(bc);
868
+ if (len === 0) {
869
+ return [];
870
+ }
871
+ const result = [readSqliteBatchStatement(bc)];
872
+ for (let i = 1; i < len; i++) {
873
+ result[i] = readSqliteBatchStatement(bc);
874
+ }
875
+ return result;
791
876
  }
792
- function readSqliteStageNotFound(bc) {
877
+ function write15(bc, x) {
878
+ bare.writeUintSafe(bc, x.length);
879
+ for (let i = 0; i < x.length; i++) {
880
+ writeSqliteBatchStatement(bc, x[i]);
881
+ }
882
+ }
883
+ function readSqliteExecuteBatchRequest(bc) {
793
884
  return {
794
- stageId: readSqliteStageId(bc)
885
+ namespaceId: readId(bc),
886
+ actorId: readId(bc),
887
+ generation: readSqliteGeneration(bc),
888
+ statements: read15(bc)
795
889
  };
796
890
  }
797
- function writeSqliteStageNotFound(bc, x) {
798
- writeSqliteStageId(bc, x.stageId);
891
+ function writeSqliteExecuteBatchRequest(bc, x) {
892
+ writeId(bc, x.namespaceId);
893
+ writeId(bc, x.actorId);
894
+ writeSqliteGeneration(bc, x.generation);
895
+ write15(bc, x.statements);
896
+ }
897
+ function readSqliteExecOk(bc) {
898
+ return {
899
+ result: readSqliteQueryResult(bc)
900
+ };
901
+ }
902
+ function writeSqliteExecOk(bc, x) {
903
+ writeSqliteQueryResult(bc, x.result);
799
904
  }
800
- function readSqliteCommitFinalizeResponse(bc) {
905
+ function readSqliteExecuteOk(bc) {
906
+ return {
907
+ result: readSqliteExecuteResult(bc)
908
+ };
909
+ }
910
+ function writeSqliteExecuteOk(bc, x) {
911
+ writeSqliteExecuteResult(bc, x.result);
912
+ }
913
+ function read16(bc) {
914
+ const len = bare.readUintSafe(bc);
915
+ if (len === 0) {
916
+ return [];
917
+ }
918
+ const result = [readSqliteExecuteResult(bc)];
919
+ for (let i = 1; i < len; i++) {
920
+ result[i] = readSqliteExecuteResult(bc);
921
+ }
922
+ return result;
923
+ }
924
+ function write16(bc, x) {
925
+ bare.writeUintSafe(bc, x.length);
926
+ for (let i = 0; i < x.length; i++) {
927
+ writeSqliteExecuteResult(bc, x[i]);
928
+ }
929
+ }
930
+ function readSqliteExecuteBatchOk(bc) {
931
+ return {
932
+ results: read16(bc)
933
+ };
934
+ }
935
+ function writeSqliteExecuteBatchOk(bc, x) {
936
+ write16(bc, x.results);
937
+ }
938
+ function readSqliteExecResponse(bc) {
801
939
  const offset = bc.offset;
802
940
  const tag = bare.readU8(bc);
803
941
  switch (tag) {
804
942
  case 0:
805
- return { tag: "SqliteCommitFinalizeOk", val: readSqliteCommitFinalizeOk(bc) };
943
+ return { tag: "SqliteExecOk", val: readSqliteExecOk(bc) };
806
944
  case 1:
807
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
808
- case 2:
809
- return { tag: "SqliteStageNotFound", val: readSqliteStageNotFound(bc) };
810
- case 3:
811
945
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
812
946
  default: {
813
947
  bc.offset = offset;
@@ -815,41 +949,75 @@ function readSqliteCommitFinalizeResponse(bc) {
815
949
  }
816
950
  }
817
951
  }
818
- function writeSqliteCommitFinalizeResponse(bc, x) {
952
+ function writeSqliteExecResponse(bc, x) {
819
953
  switch (x.tag) {
820
- case "SqliteCommitFinalizeOk": {
954
+ case "SqliteExecOk": {
821
955
  bare.writeU8(bc, 0);
822
- writeSqliteCommitFinalizeOk(bc, x.val);
956
+ writeSqliteExecOk(bc, x.val);
823
957
  break;
824
958
  }
825
- case "SqliteFenceMismatch": {
959
+ case "SqliteErrorResponse": {
826
960
  bare.writeU8(bc, 1);
827
- writeSqliteFenceMismatch(bc, x.val);
961
+ writeSqliteErrorResponse(bc, x.val);
828
962
  break;
829
963
  }
830
- case "SqliteStageNotFound": {
831
- bare.writeU8(bc, 2);
832
- writeSqliteStageNotFound(bc, x.val);
964
+ }
965
+ }
966
+ function readSqliteExecuteResponse(bc) {
967
+ const offset = bc.offset;
968
+ const tag = bare.readU8(bc);
969
+ switch (tag) {
970
+ case 0:
971
+ return { tag: "SqliteExecuteOk", val: readSqliteExecuteOk(bc) };
972
+ case 1:
973
+ return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
974
+ default: {
975
+ bc.offset = offset;
976
+ throw new bare.BareError(offset, "invalid tag");
977
+ }
978
+ }
979
+ }
980
+ function writeSqliteExecuteResponse(bc, x) {
981
+ switch (x.tag) {
982
+ case "SqliteExecuteOk": {
983
+ bare.writeU8(bc, 0);
984
+ writeSqliteExecuteOk(bc, x.val);
833
985
  break;
834
986
  }
835
987
  case "SqliteErrorResponse": {
836
- bare.writeU8(bc, 3);
988
+ bare.writeU8(bc, 1);
837
989
  writeSqliteErrorResponse(bc, x.val);
838
990
  break;
839
991
  }
840
992
  }
841
993
  }
842
- function readSqliteStartupData(bc) {
843
- return {
844
- generation: readSqliteGeneration(bc),
845
- meta: readSqliteMeta(bc),
846
- preloadedPages: read7(bc)
847
- };
994
+ function readSqliteExecuteBatchResponse(bc) {
995
+ const offset = bc.offset;
996
+ const tag = bare.readU8(bc);
997
+ switch (tag) {
998
+ case 0:
999
+ return { tag: "SqliteExecuteBatchOk", val: readSqliteExecuteBatchOk(bc) };
1000
+ case 1:
1001
+ return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
1002
+ default: {
1003
+ bc.offset = offset;
1004
+ throw new bare.BareError(offset, "invalid tag");
1005
+ }
1006
+ }
848
1007
  }
849
- function writeSqliteStartupData(bc, x) {
850
- writeSqliteGeneration(bc, x.generation);
851
- writeSqliteMeta(bc, x.meta);
852
- write7(bc, x.preloadedPages);
1008
+ function writeSqliteExecuteBatchResponse(bc, x) {
1009
+ switch (x.tag) {
1010
+ case "SqliteExecuteBatchOk": {
1011
+ bare.writeU8(bc, 0);
1012
+ writeSqliteExecuteBatchOk(bc, x.val);
1013
+ break;
1014
+ }
1015
+ case "SqliteErrorResponse": {
1016
+ bare.writeU8(bc, 1);
1017
+ writeSqliteErrorResponse(bc, x.val);
1018
+ break;
1019
+ }
1020
+ }
853
1021
  }
854
1022
  var StopCode = /* @__PURE__ */ ((StopCode2) => {
855
1023
  StopCode2["Ok"] = "Ok";
@@ -890,19 +1058,19 @@ function readActorName(bc) {
890
1058
  function writeActorName(bc, x) {
891
1059
  writeJson(bc, x.metadata);
892
1060
  }
893
- function read9(bc) {
1061
+ function read17(bc) {
894
1062
  return bare.readBool(bc) ? bare.readString(bc) : null;
895
1063
  }
896
- function write9(bc, x) {
1064
+ function write17(bc, x) {
897
1065
  bare.writeBool(bc, x != null);
898
1066
  if (x != null) {
899
1067
  bare.writeString(bc, x);
900
1068
  }
901
1069
  }
902
- function read10(bc) {
1070
+ function read18(bc) {
903
1071
  return bare.readBool(bc) ? bare.readData(bc) : null;
904
1072
  }
905
- function write10(bc, x) {
1073
+ function write18(bc, x) {
906
1074
  bare.writeBool(bc, x != null);
907
1075
  if (x != null) {
908
1076
  bare.writeData(bc, x);
@@ -911,16 +1079,16 @@ function write10(bc, x) {
911
1079
  function readActorConfig(bc) {
912
1080
  return {
913
1081
  name: bare.readString(bc),
914
- key: read9(bc),
1082
+ key: read17(bc),
915
1083
  createTs: bare.readI64(bc),
916
- input: read10(bc)
1084
+ input: read18(bc)
917
1085
  };
918
1086
  }
919
1087
  function writeActorConfig(bc, x) {
920
1088
  bare.writeString(bc, x.name);
921
- write9(bc, x.key);
1089
+ write17(bc, x.key);
922
1090
  bare.writeI64(bc, x.createTs);
923
- write10(bc, x.input);
1091
+ write18(bc, x.input);
924
1092
  }
925
1093
  function readActorCheckpoint(bc) {
926
1094
  return {
@@ -963,12 +1131,12 @@ function writeActorIntent(bc, x) {
963
1131
  function readActorStateStopped(bc) {
964
1132
  return {
965
1133
  code: readStopCode(bc),
966
- message: read9(bc)
1134
+ message: read17(bc)
967
1135
  };
968
1136
  }
969
1137
  function writeActorStateStopped(bc, x) {
970
1138
  writeStopCode(bc, x.code);
971
- write9(bc, x.message);
1139
+ write17(bc, x.message);
972
1140
  }
973
1141
  function readActorState(bc) {
974
1142
  const offset = bc.offset;
@@ -1013,22 +1181,13 @@ function readEventActorStateUpdate(bc) {
1013
1181
  function writeEventActorStateUpdate(bc, x) {
1014
1182
  writeActorState(bc, x.state);
1015
1183
  }
1016
- function read11(bc) {
1017
- return bare.readBool(bc) ? bare.readI64(bc) : null;
1018
- }
1019
- function write11(bc, x) {
1020
- bare.writeBool(bc, x != null);
1021
- if (x != null) {
1022
- bare.writeI64(bc, x);
1023
- }
1024
- }
1025
1184
  function readEventActorSetAlarm(bc) {
1026
1185
  return {
1027
- alarmTs: read11(bc)
1186
+ alarmTs: read12(bc)
1028
1187
  };
1029
1188
  }
1030
1189
  function writeEventActorSetAlarm(bc, x) {
1031
- write11(bc, x.alarmTs);
1190
+ write12(bc, x.alarmTs);
1032
1191
  }
1033
1192
  function readEvent(bc) {
1034
1193
  const offset = bc.offset;
@@ -1087,7 +1246,7 @@ function writePreloadedKvEntry(bc, x) {
1087
1246
  writeKvValue(bc, x.value);
1088
1247
  writeKvMetadata(bc, x.metadata);
1089
1248
  }
1090
- function read12(bc) {
1249
+ function read19(bc) {
1091
1250
  const len = bare.readUintSafe(bc);
1092
1251
  if (len === 0) {
1093
1252
  return [];
@@ -1098,7 +1257,7 @@ function read12(bc) {
1098
1257
  }
1099
1258
  return result;
1100
1259
  }
1101
- function write12(bc, x) {
1260
+ function write19(bc, x) {
1102
1261
  bare.writeUintSafe(bc, x.length);
1103
1262
  for (let i = 0; i < x.length; i++) {
1104
1263
  writePreloadedKvEntry(bc, x[i]);
@@ -1106,13 +1265,13 @@ function write12(bc, x) {
1106
1265
  }
1107
1266
  function readPreloadedKv(bc) {
1108
1267
  return {
1109
- entries: read12(bc),
1268
+ entries: read19(bc),
1110
1269
  requestedGetKeys: read0(bc),
1111
1270
  requestedPrefixes: read0(bc)
1112
1271
  };
1113
1272
  }
1114
1273
  function writePreloadedKv(bc, x) {
1115
- write12(bc, x.entries);
1274
+ write19(bc, x.entries);
1116
1275
  write0(bc, x.requestedGetKeys);
1117
1276
  write0(bc, x.requestedPrefixes);
1118
1277
  }
@@ -1126,7 +1285,7 @@ function writeHibernatingRequest(bc, x) {
1126
1285
  writeGatewayId(bc, x.gatewayId);
1127
1286
  writeRequestId(bc, x.requestId);
1128
1287
  }
1129
- function read13(bc) {
1288
+ function read20(bc) {
1130
1289
  const len = bare.readUintSafe(bc);
1131
1290
  if (len === 0) {
1132
1291
  return [];
@@ -1137,43 +1296,32 @@ function read13(bc) {
1137
1296
  }
1138
1297
  return result;
1139
1298
  }
1140
- function write13(bc, x) {
1299
+ function write20(bc, x) {
1141
1300
  bare.writeUintSafe(bc, x.length);
1142
1301
  for (let i = 0; i < x.length; i++) {
1143
1302
  writeHibernatingRequest(bc, x[i]);
1144
1303
  }
1145
1304
  }
1146
- function read14(bc) {
1305
+ function read21(bc) {
1147
1306
  return bare.readBool(bc) ? readPreloadedKv(bc) : null;
1148
1307
  }
1149
- function write14(bc, x) {
1308
+ function write21(bc, x) {
1150
1309
  bare.writeBool(bc, x != null);
1151
1310
  if (x != null) {
1152
1311
  writePreloadedKv(bc, x);
1153
1312
  }
1154
1313
  }
1155
- function read15(bc) {
1156
- return bare.readBool(bc) ? readSqliteStartupData(bc) : null;
1157
- }
1158
- function write15(bc, x) {
1159
- bare.writeBool(bc, x != null);
1160
- if (x != null) {
1161
- writeSqliteStartupData(bc, x);
1162
- }
1163
- }
1164
1314
  function readCommandStartActor(bc) {
1165
1315
  return {
1166
1316
  config: readActorConfig(bc),
1167
- hibernatingRequests: read13(bc),
1168
- preloadedKv: read14(bc),
1169
- sqliteStartupData: read15(bc)
1317
+ hibernatingRequests: read20(bc),
1318
+ preloadedKv: read21(bc)
1170
1319
  };
1171
1320
  }
1172
1321
  function writeCommandStartActor(bc, x) {
1173
1322
  writeActorConfig(bc, x.config);
1174
- write13(bc, x.hibernatingRequests);
1175
- write14(bc, x.preloadedKv);
1176
- write15(bc, x.sqliteStartupData);
1323
+ write20(bc, x.hibernatingRequests);
1324
+ write21(bc, x.preloadedKv);
1177
1325
  }
1178
1326
  var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
1179
1327
  StopActorReason2["SleepIntent"] = "SleepIntent";
@@ -1330,7 +1478,7 @@ function writeMessageId(bc, x) {
1330
1478
  writeRequestId(bc, x.requestId);
1331
1479
  writeMessageIndex(bc, x.messageIndex);
1332
1480
  }
1333
- function read16(bc) {
1481
+ function read22(bc) {
1334
1482
  const len = bare.readUintSafe(bc);
1335
1483
  const result = /* @__PURE__ */ new Map();
1336
1484
  for (let i = 0; i < len; i++) {
@@ -1344,7 +1492,7 @@ function read16(bc) {
1344
1492
  }
1345
1493
  return result;
1346
1494
  }
1347
- function write16(bc, x) {
1495
+ function write22(bc, x) {
1348
1496
  bare.writeUintSafe(bc, x.size);
1349
1497
  for (const kv of x) {
1350
1498
  bare.writeString(bc, kv[0]);
@@ -1356,8 +1504,8 @@ function readToEnvoyRequestStart(bc) {
1356
1504
  actorId: readId(bc),
1357
1505
  method: bare.readString(bc),
1358
1506
  path: bare.readString(bc),
1359
- headers: read16(bc),
1360
- body: read10(bc),
1507
+ headers: read22(bc),
1508
+ body: read18(bc),
1361
1509
  stream: bare.readBool(bc)
1362
1510
  };
1363
1511
  }
@@ -1365,8 +1513,8 @@ function writeToEnvoyRequestStart(bc, x) {
1365
1513
  writeId(bc, x.actorId);
1366
1514
  bare.writeString(bc, x.method);
1367
1515
  bare.writeString(bc, x.path);
1368
- write16(bc, x.headers);
1369
- write10(bc, x.body);
1516
+ write22(bc, x.headers);
1517
+ write18(bc, x.body);
1370
1518
  bare.writeBool(bc, x.stream);
1371
1519
  }
1372
1520
  function readToEnvoyRequestChunk(bc) {
@@ -1382,15 +1530,15 @@ function writeToEnvoyRequestChunk(bc, x) {
1382
1530
  function readToRivetResponseStart(bc) {
1383
1531
  return {
1384
1532
  status: bare.readU16(bc),
1385
- headers: read16(bc),
1386
- body: read10(bc),
1533
+ headers: read22(bc),
1534
+ body: read18(bc),
1387
1535
  stream: bare.readBool(bc)
1388
1536
  };
1389
1537
  }
1390
1538
  function writeToRivetResponseStart(bc, x) {
1391
1539
  bare.writeU16(bc, x.status);
1392
- write16(bc, x.headers);
1393
- write10(bc, x.body);
1540
+ write22(bc, x.headers);
1541
+ write18(bc, x.body);
1394
1542
  bare.writeBool(bc, x.stream);
1395
1543
  }
1396
1544
  function readToRivetResponseChunk(bc) {
@@ -1407,13 +1555,13 @@ function readToEnvoyWebSocketOpen(bc) {
1407
1555
  return {
1408
1556
  actorId: readId(bc),
1409
1557
  path: bare.readString(bc),
1410
- headers: read16(bc)
1558
+ headers: read22(bc)
1411
1559
  };
1412
1560
  }
1413
1561
  function writeToEnvoyWebSocketOpen(bc, x) {
1414
1562
  writeId(bc, x.actorId);
1415
1563
  bare.writeString(bc, x.path);
1416
- write16(bc, x.headers);
1564
+ write22(bc, x.headers);
1417
1565
  }
1418
1566
  function readToEnvoyWebSocketMessage(bc) {
1419
1567
  return {
@@ -1425,10 +1573,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
1425
1573
  bare.writeData(bc, x.data);
1426
1574
  bare.writeBool(bc, x.binary);
1427
1575
  }
1428
- function read17(bc) {
1576
+ function read23(bc) {
1429
1577
  return bare.readBool(bc) ? bare.readU16(bc) : null;
1430
1578
  }
1431
- function write17(bc, x) {
1579
+ function write23(bc, x) {
1432
1580
  bare.writeBool(bc, x != null);
1433
1581
  if (x != null) {
1434
1582
  bare.writeU16(bc, x);
@@ -1436,13 +1584,13 @@ function write17(bc, x) {
1436
1584
  }
1437
1585
  function readToEnvoyWebSocketClose(bc) {
1438
1586
  return {
1439
- code: read17(bc),
1440
- reason: read9(bc)
1587
+ code: read23(bc),
1588
+ reason: read17(bc)
1441
1589
  };
1442
1590
  }
1443
1591
  function writeToEnvoyWebSocketClose(bc, x) {
1444
- write17(bc, x.code);
1445
- write9(bc, x.reason);
1592
+ write23(bc, x.code);
1593
+ write17(bc, x.reason);
1446
1594
  }
1447
1595
  function readToRivetWebSocketOpen(bc) {
1448
1596
  return {
@@ -1472,14 +1620,14 @@ function writeToRivetWebSocketMessageAck(bc, x) {
1472
1620
  }
1473
1621
  function readToRivetWebSocketClose(bc) {
1474
1622
  return {
1475
- code: read17(bc),
1476
- reason: read9(bc),
1623
+ code: read23(bc),
1624
+ reason: read17(bc),
1477
1625
  hibernate: bare.readBool(bc)
1478
1626
  };
1479
1627
  }
1480
1628
  function writeToRivetWebSocketClose(bc, x) {
1481
- write17(bc, x.code);
1482
- write9(bc, x.reason);
1629
+ write23(bc, x.code);
1630
+ write17(bc, x.reason);
1483
1631
  bare.writeBool(bc, x.hibernate);
1484
1632
  }
1485
1633
  function readToRivetTunnelMessageKind(bc) {
@@ -1627,7 +1775,7 @@ function readToEnvoyPing(bc) {
1627
1775
  function writeToEnvoyPing(bc, x) {
1628
1776
  bare.writeI64(bc, x.ts);
1629
1777
  }
1630
- function read18(bc) {
1778
+ function read24(bc) {
1631
1779
  const len = bare.readUintSafe(bc);
1632
1780
  const result = /* @__PURE__ */ new Map();
1633
1781
  for (let i = 0; i < len; i++) {
@@ -1641,26 +1789,26 @@ function read18(bc) {
1641
1789
  }
1642
1790
  return result;
1643
1791
  }
1644
- function write18(bc, x) {
1792
+ function write24(bc, x) {
1645
1793
  bare.writeUintSafe(bc, x.size);
1646
1794
  for (const kv of x) {
1647
1795
  bare.writeString(bc, kv[0]);
1648
1796
  writeActorName(bc, kv[1]);
1649
1797
  }
1650
1798
  }
1651
- function read19(bc) {
1652
- return bare.readBool(bc) ? read18(bc) : null;
1799
+ function read25(bc) {
1800
+ return bare.readBool(bc) ? read24(bc) : null;
1653
1801
  }
1654
- function write19(bc, x) {
1802
+ function write25(bc, x) {
1655
1803
  bare.writeBool(bc, x != null);
1656
1804
  if (x != null) {
1657
- write18(bc, x);
1805
+ write24(bc, x);
1658
1806
  }
1659
1807
  }
1660
- function read20(bc) {
1808
+ function read26(bc) {
1661
1809
  return bare.readBool(bc) ? readJson(bc) : null;
1662
1810
  }
1663
- function write20(bc, x) {
1811
+ function write26(bc, x) {
1664
1812
  bare.writeBool(bc, x != null);
1665
1813
  if (x != null) {
1666
1814
  writeJson(bc, x);
@@ -1668,13 +1816,13 @@ function write20(bc, x) {
1668
1816
  }
1669
1817
  function readToRivetMetadata(bc) {
1670
1818
  return {
1671
- prepopulateActorNames: read19(bc),
1672
- metadata: read20(bc)
1819
+ prepopulateActorNames: read25(bc),
1820
+ metadata: read26(bc)
1673
1821
  };
1674
1822
  }
1675
1823
  function writeToRivetMetadata(bc, x) {
1676
- write19(bc, x.prepopulateActorNames);
1677
- write20(bc, x.metadata);
1824
+ write25(bc, x.prepopulateActorNames);
1825
+ write26(bc, x.metadata);
1678
1826
  }
1679
1827
  function readToRivetEvents(bc) {
1680
1828
  const len = bare.readUintSafe(bc);
@@ -1693,7 +1841,7 @@ function writeToRivetEvents(bc, x) {
1693
1841
  writeEventWrapper(bc, x[i]);
1694
1842
  }
1695
1843
  }
1696
- function read21(bc) {
1844
+ function read27(bc) {
1697
1845
  const len = bare.readUintSafe(bc);
1698
1846
  if (len === 0) {
1699
1847
  return [];
@@ -1704,7 +1852,7 @@ function read21(bc) {
1704
1852
  }
1705
1853
  return result;
1706
1854
  }
1707
- function write21(bc, x) {
1855
+ function write27(bc, x) {
1708
1856
  bare.writeUintSafe(bc, x.length);
1709
1857
  for (let i = 0; i < x.length; i++) {
1710
1858
  writeActorCheckpoint(bc, x[i]);
@@ -1712,11 +1860,11 @@ function write21(bc, x) {
1712
1860
  }
1713
1861
  function readToRivetAckCommands(bc) {
1714
1862
  return {
1715
- lastCommandCheckpoints: read21(bc)
1863
+ lastCommandCheckpoints: read27(bc)
1716
1864
  };
1717
1865
  }
1718
1866
  function writeToRivetAckCommands(bc, x) {
1719
- write21(bc, x.lastCommandCheckpoints);
1867
+ write27(bc, x.lastCommandCheckpoints);
1720
1868
  }
1721
1869
  function readToRivetPong(bc) {
1722
1870
  return {
@@ -1758,35 +1906,35 @@ function writeToRivetSqliteCommitRequest(bc, x) {
1758
1906
  bare.writeU32(bc, x.requestId);
1759
1907
  writeSqliteCommitRequest(bc, x.data);
1760
1908
  }
1761
- function readToRivetSqliteCommitStageBeginRequest(bc) {
1909
+ function readToRivetSqliteExecRequest(bc) {
1762
1910
  return {
1763
1911
  requestId: bare.readU32(bc),
1764
- data: readSqliteCommitStageBeginRequest(bc)
1912
+ data: readSqliteExecRequest(bc)
1765
1913
  };
1766
1914
  }
1767
- function writeToRivetSqliteCommitStageBeginRequest(bc, x) {
1915
+ function writeToRivetSqliteExecRequest(bc, x) {
1768
1916
  bare.writeU32(bc, x.requestId);
1769
- writeSqliteCommitStageBeginRequest(bc, x.data);
1917
+ writeSqliteExecRequest(bc, x.data);
1770
1918
  }
1771
- function readToRivetSqliteCommitStageRequest(bc) {
1919
+ function readToRivetSqliteExecuteRequest(bc) {
1772
1920
  return {
1773
1921
  requestId: bare.readU32(bc),
1774
- data: readSqliteCommitStageRequest(bc)
1922
+ data: readSqliteExecuteRequest(bc)
1775
1923
  };
1776
1924
  }
1777
- function writeToRivetSqliteCommitStageRequest(bc, x) {
1925
+ function writeToRivetSqliteExecuteRequest(bc, x) {
1778
1926
  bare.writeU32(bc, x.requestId);
1779
- writeSqliteCommitStageRequest(bc, x.data);
1927
+ writeSqliteExecuteRequest(bc, x.data);
1780
1928
  }
1781
- function readToRivetSqliteCommitFinalizeRequest(bc) {
1929
+ function readToRivetSqliteExecuteBatchRequest(bc) {
1782
1930
  return {
1783
1931
  requestId: bare.readU32(bc),
1784
- data: readSqliteCommitFinalizeRequest(bc)
1932
+ data: readSqliteExecuteBatchRequest(bc)
1785
1933
  };
1786
1934
  }
1787
- function writeToRivetSqliteCommitFinalizeRequest(bc, x) {
1935
+ function writeToRivetSqliteExecuteBatchRequest(bc, x) {
1788
1936
  bare.writeU32(bc, x.requestId);
1789
- writeSqliteCommitFinalizeRequest(bc, x.data);
1937
+ writeSqliteExecuteBatchRequest(bc, x.data);
1790
1938
  }
1791
1939
  function readToRivet(bc) {
1792
1940
  const offset = bc.offset;
@@ -1811,11 +1959,11 @@ function readToRivet(bc) {
1811
1959
  case 8:
1812
1960
  return { tag: "ToRivetSqliteCommitRequest", val: readToRivetSqliteCommitRequest(bc) };
1813
1961
  case 9:
1814
- return { tag: "ToRivetSqliteCommitStageBeginRequest", val: readToRivetSqliteCommitStageBeginRequest(bc) };
1962
+ return { tag: "ToRivetSqliteExecRequest", val: readToRivetSqliteExecRequest(bc) };
1815
1963
  case 10:
1816
- return { tag: "ToRivetSqliteCommitStageRequest", val: readToRivetSqliteCommitStageRequest(bc) };
1964
+ return { tag: "ToRivetSqliteExecuteRequest", val: readToRivetSqliteExecuteRequest(bc) };
1817
1965
  case 11:
1818
- return { tag: "ToRivetSqliteCommitFinalizeRequest", val: readToRivetSqliteCommitFinalizeRequest(bc) };
1966
+ return { tag: "ToRivetSqliteExecuteBatchRequest", val: readToRivetSqliteExecuteBatchRequest(bc) };
1819
1967
  default: {
1820
1968
  bc.offset = offset;
1821
1969
  throw new bare.BareError(offset, "invalid tag");
@@ -1868,19 +2016,19 @@ function writeToRivet(bc, x) {
1868
2016
  writeToRivetSqliteCommitRequest(bc, x.val);
1869
2017
  break;
1870
2018
  }
1871
- case "ToRivetSqliteCommitStageBeginRequest": {
2019
+ case "ToRivetSqliteExecRequest": {
1872
2020
  bare.writeU8(bc, 9);
1873
- writeToRivetSqliteCommitStageBeginRequest(bc, x.val);
2021
+ writeToRivetSqliteExecRequest(bc, x.val);
1874
2022
  break;
1875
2023
  }
1876
- case "ToRivetSqliteCommitStageRequest": {
2024
+ case "ToRivetSqliteExecuteRequest": {
1877
2025
  bare.writeU8(bc, 10);
1878
- writeToRivetSqliteCommitStageRequest(bc, x.val);
2026
+ writeToRivetSqliteExecuteRequest(bc, x.val);
1879
2027
  break;
1880
2028
  }
1881
- case "ToRivetSqliteCommitFinalizeRequest": {
2029
+ case "ToRivetSqliteExecuteBatchRequest": {
1882
2030
  bare.writeU8(bc, 11);
1883
- writeToRivetSqliteCommitFinalizeRequest(bc, x.val);
2031
+ writeToRivetSqliteExecuteBatchRequest(bc, x.val);
1884
2032
  break;
1885
2033
  }
1886
2034
  }
@@ -1941,11 +2089,11 @@ function writeToEnvoyCommands(bc, x) {
1941
2089
  }
1942
2090
  function readToEnvoyAckEvents(bc) {
1943
2091
  return {
1944
- lastEventCheckpoints: read21(bc)
2092
+ lastEventCheckpoints: read27(bc)
1945
2093
  };
1946
2094
  }
1947
2095
  function writeToEnvoyAckEvents(bc, x) {
1948
- write21(bc, x.lastEventCheckpoints);
2096
+ write27(bc, x.lastEventCheckpoints);
1949
2097
  }
1950
2098
  function readToEnvoyKvResponse(bc) {
1951
2099
  return {
@@ -1977,35 +2125,35 @@ function writeToEnvoySqliteCommitResponse(bc, x) {
1977
2125
  bare.writeU32(bc, x.requestId);
1978
2126
  writeSqliteCommitResponse(bc, x.data);
1979
2127
  }
1980
- function readToEnvoySqliteCommitStageBeginResponse(bc) {
2128
+ function readToEnvoySqliteExecResponse(bc) {
1981
2129
  return {
1982
2130
  requestId: bare.readU32(bc),
1983
- data: readSqliteCommitStageBeginResponse(bc)
2131
+ data: readSqliteExecResponse(bc)
1984
2132
  };
1985
2133
  }
1986
- function writeToEnvoySqliteCommitStageBeginResponse(bc, x) {
2134
+ function writeToEnvoySqliteExecResponse(bc, x) {
1987
2135
  bare.writeU32(bc, x.requestId);
1988
- writeSqliteCommitStageBeginResponse(bc, x.data);
2136
+ writeSqliteExecResponse(bc, x.data);
1989
2137
  }
1990
- function readToEnvoySqliteCommitStageResponse(bc) {
2138
+ function readToEnvoySqliteExecuteResponse(bc) {
1991
2139
  return {
1992
2140
  requestId: bare.readU32(bc),
1993
- data: readSqliteCommitStageResponse(bc)
2141
+ data: readSqliteExecuteResponse(bc)
1994
2142
  };
1995
2143
  }
1996
- function writeToEnvoySqliteCommitStageResponse(bc, x) {
2144
+ function writeToEnvoySqliteExecuteResponse(bc, x) {
1997
2145
  bare.writeU32(bc, x.requestId);
1998
- writeSqliteCommitStageResponse(bc, x.data);
2146
+ writeSqliteExecuteResponse(bc, x.data);
1999
2147
  }
2000
- function readToEnvoySqliteCommitFinalizeResponse(bc) {
2148
+ function readToEnvoySqliteExecuteBatchResponse(bc) {
2001
2149
  return {
2002
2150
  requestId: bare.readU32(bc),
2003
- data: readSqliteCommitFinalizeResponse(bc)
2151
+ data: readSqliteExecuteBatchResponse(bc)
2004
2152
  };
2005
2153
  }
2006
- function writeToEnvoySqliteCommitFinalizeResponse(bc, x) {
2154
+ function writeToEnvoySqliteExecuteBatchResponse(bc, x) {
2007
2155
  bare.writeU32(bc, x.requestId);
2008
- writeSqliteCommitFinalizeResponse(bc, x.data);
2156
+ writeSqliteExecuteBatchResponse(bc, x.data);
2009
2157
  }
2010
2158
  function readToEnvoy(bc) {
2011
2159
  const offset = bc.offset;
@@ -2028,11 +2176,11 @@ function readToEnvoy(bc) {
2028
2176
  case 7:
2029
2177
  return { tag: "ToEnvoySqliteCommitResponse", val: readToEnvoySqliteCommitResponse(bc) };
2030
2178
  case 8:
2031
- return { tag: "ToEnvoySqliteCommitStageBeginResponse", val: readToEnvoySqliteCommitStageBeginResponse(bc) };
2179
+ return { tag: "ToEnvoySqliteExecResponse", val: readToEnvoySqliteExecResponse(bc) };
2032
2180
  case 9:
2033
- return { tag: "ToEnvoySqliteCommitStageResponse", val: readToEnvoySqliteCommitStageResponse(bc) };
2181
+ return { tag: "ToEnvoySqliteExecuteResponse", val: readToEnvoySqliteExecuteResponse(bc) };
2034
2182
  case 10:
2035
- return { tag: "ToEnvoySqliteCommitFinalizeResponse", val: readToEnvoySqliteCommitFinalizeResponse(bc) };
2183
+ return { tag: "ToEnvoySqliteExecuteBatchResponse", val: readToEnvoySqliteExecuteBatchResponse(bc) };
2036
2184
  default: {
2037
2185
  bc.offset = offset;
2038
2186
  throw new bare.BareError(offset, "invalid tag");
@@ -2081,19 +2229,19 @@ function writeToEnvoy(bc, x) {
2081
2229
  writeToEnvoySqliteCommitResponse(bc, x.val);
2082
2230
  break;
2083
2231
  }
2084
- case "ToEnvoySqliteCommitStageBeginResponse": {
2232
+ case "ToEnvoySqliteExecResponse": {
2085
2233
  bare.writeU8(bc, 8);
2086
- writeToEnvoySqliteCommitStageBeginResponse(bc, x.val);
2234
+ writeToEnvoySqliteExecResponse(bc, x.val);
2087
2235
  break;
2088
2236
  }
2089
- case "ToEnvoySqliteCommitStageResponse": {
2237
+ case "ToEnvoySqliteExecuteResponse": {
2090
2238
  bare.writeU8(bc, 9);
2091
- writeToEnvoySqliteCommitStageResponse(bc, x.val);
2239
+ writeToEnvoySqliteExecuteResponse(bc, x.val);
2092
2240
  break;
2093
2241
  }
2094
- case "ToEnvoySqliteCommitFinalizeResponse": {
2242
+ case "ToEnvoySqliteExecuteBatchResponse": {
2095
2243
  bare.writeU8(bc, 10);
2096
- writeToEnvoySqliteCommitFinalizeResponse(bc, x.val);
2244
+ writeToEnvoySqliteExecuteBatchResponse(bc, x.val);
2097
2245
  break;
2098
2246
  }
2099
2247
  }
@@ -2302,7 +2450,7 @@ function decodeToOutbound(bytes) {
2302
2450
  function assert(condition, message) {
2303
2451
  if (!condition) throw new Error(message ?? "Assertion failed");
2304
2452
  }
2305
- var VERSION = 2;
2453
+ var VERSION = 6;
2306
2454
  export {
2307
2455
  StopActorReason,
2308
2456
  StopCode,
@@ -2361,34 +2509,36 @@ export {
2361
2509
  readPreloadedKvEntry,
2362
2510
  readProtocolMetadata,
2363
2511
  readRequestId,
2364
- readSqliteCommitFinalizeOk,
2365
- readSqliteCommitFinalizeRequest,
2366
- readSqliteCommitFinalizeResponse,
2512
+ readSqliteBatchStatement,
2513
+ readSqliteBindParam,
2514
+ readSqliteColumnValue,
2367
2515
  readSqliteCommitOk,
2368
2516
  readSqliteCommitRequest,
2369
2517
  readSqliteCommitResponse,
2370
- readSqliteCommitStageBeginOk,
2371
- readSqliteCommitStageBeginRequest,
2372
- readSqliteCommitStageBeginResponse,
2373
- readSqliteCommitStageOk,
2374
- readSqliteCommitStageRequest,
2375
- readSqliteCommitStageResponse,
2376
- readSqliteCommitTooLarge,
2377
2518
  readSqliteDirtyPage,
2378
2519
  readSqliteErrorResponse,
2379
- readSqliteFenceMismatch,
2520
+ readSqliteExecOk,
2521
+ readSqliteExecRequest,
2522
+ readSqliteExecResponse,
2523
+ readSqliteExecuteBatchOk,
2524
+ readSqliteExecuteBatchRequest,
2525
+ readSqliteExecuteBatchResponse,
2526
+ readSqliteExecuteOk,
2527
+ readSqliteExecuteRequest,
2528
+ readSqliteExecuteResponse,
2529
+ readSqliteExecuteResult,
2380
2530
  readSqliteFetchedPage,
2381
2531
  readSqliteGeneration,
2382
2532
  readSqliteGetPagesOk,
2383
2533
  readSqliteGetPagesRequest,
2384
2534
  readSqliteGetPagesResponse,
2385
- readSqliteMeta,
2386
2535
  readSqlitePageBytes,
2387
2536
  readSqlitePgno,
2388
- readSqliteStageId,
2389
- readSqliteStageNotFound,
2390
- readSqliteStartupData,
2391
- readSqliteTxid,
2537
+ readSqliteQueryResult,
2538
+ readSqliteValueBlob,
2539
+ readSqliteValueFloat,
2540
+ readSqliteValueInteger,
2541
+ readSqliteValueText,
2392
2542
  readStopActorReason,
2393
2543
  readStopCode,
2394
2544
  readToEnvoy,
@@ -2401,10 +2551,10 @@ export {
2401
2551
  readToEnvoyPing,
2402
2552
  readToEnvoyRequestChunk,
2403
2553
  readToEnvoyRequestStart,
2404
- readToEnvoySqliteCommitFinalizeResponse,
2405
2554
  readToEnvoySqliteCommitResponse,
2406
- readToEnvoySqliteCommitStageBeginResponse,
2407
- readToEnvoySqliteCommitStageResponse,
2555
+ readToEnvoySqliteExecResponse,
2556
+ readToEnvoySqliteExecuteBatchResponse,
2557
+ readToEnvoySqliteExecuteResponse,
2408
2558
  readToEnvoySqliteGetPagesResponse,
2409
2559
  readToEnvoyTunnelMessage,
2410
2560
  readToEnvoyTunnelMessageKind,
@@ -2423,10 +2573,10 @@ export {
2423
2573
  readToRivetPong,
2424
2574
  readToRivetResponseChunk,
2425
2575
  readToRivetResponseStart,
2426
- readToRivetSqliteCommitFinalizeRequest,
2427
2576
  readToRivetSqliteCommitRequest,
2428
- readToRivetSqliteCommitStageBeginRequest,
2429
- readToRivetSqliteCommitStageRequest,
2577
+ readToRivetSqliteExecRequest,
2578
+ readToRivetSqliteExecuteBatchRequest,
2579
+ readToRivetSqliteExecuteRequest,
2430
2580
  readToRivetSqliteGetPagesRequest,
2431
2581
  readToRivetTunnelMessage,
2432
2582
  readToRivetTunnelMessageKind,
@@ -2476,34 +2626,36 @@ export {
2476
2626
  writePreloadedKvEntry,
2477
2627
  writeProtocolMetadata,
2478
2628
  writeRequestId,
2479
- writeSqliteCommitFinalizeOk,
2480
- writeSqliteCommitFinalizeRequest,
2481
- writeSqliteCommitFinalizeResponse,
2629
+ writeSqliteBatchStatement,
2630
+ writeSqliteBindParam,
2631
+ writeSqliteColumnValue,
2482
2632
  writeSqliteCommitOk,
2483
2633
  writeSqliteCommitRequest,
2484
2634
  writeSqliteCommitResponse,
2485
- writeSqliteCommitStageBeginOk,
2486
- writeSqliteCommitStageBeginRequest,
2487
- writeSqliteCommitStageBeginResponse,
2488
- writeSqliteCommitStageOk,
2489
- writeSqliteCommitStageRequest,
2490
- writeSqliteCommitStageResponse,
2491
- writeSqliteCommitTooLarge,
2492
2635
  writeSqliteDirtyPage,
2493
2636
  writeSqliteErrorResponse,
2494
- writeSqliteFenceMismatch,
2637
+ writeSqliteExecOk,
2638
+ writeSqliteExecRequest,
2639
+ writeSqliteExecResponse,
2640
+ writeSqliteExecuteBatchOk,
2641
+ writeSqliteExecuteBatchRequest,
2642
+ writeSqliteExecuteBatchResponse,
2643
+ writeSqliteExecuteOk,
2644
+ writeSqliteExecuteRequest,
2645
+ writeSqliteExecuteResponse,
2646
+ writeSqliteExecuteResult,
2495
2647
  writeSqliteFetchedPage,
2496
2648
  writeSqliteGeneration,
2497
2649
  writeSqliteGetPagesOk,
2498
2650
  writeSqliteGetPagesRequest,
2499
2651
  writeSqliteGetPagesResponse,
2500
- writeSqliteMeta,
2501
2652
  writeSqlitePageBytes,
2502
2653
  writeSqlitePgno,
2503
- writeSqliteStageId,
2504
- writeSqliteStageNotFound,
2505
- writeSqliteStartupData,
2506
- writeSqliteTxid,
2654
+ writeSqliteQueryResult,
2655
+ writeSqliteValueBlob,
2656
+ writeSqliteValueFloat,
2657
+ writeSqliteValueInteger,
2658
+ writeSqliteValueText,
2507
2659
  writeStopActorReason,
2508
2660
  writeStopCode,
2509
2661
  writeToEnvoy,
@@ -2516,10 +2668,10 @@ export {
2516
2668
  writeToEnvoyPing,
2517
2669
  writeToEnvoyRequestChunk,
2518
2670
  writeToEnvoyRequestStart,
2519
- writeToEnvoySqliteCommitFinalizeResponse,
2520
2671
  writeToEnvoySqliteCommitResponse,
2521
- writeToEnvoySqliteCommitStageBeginResponse,
2522
- writeToEnvoySqliteCommitStageResponse,
2672
+ writeToEnvoySqliteExecResponse,
2673
+ writeToEnvoySqliteExecuteBatchResponse,
2674
+ writeToEnvoySqliteExecuteResponse,
2523
2675
  writeToEnvoySqliteGetPagesResponse,
2524
2676
  writeToEnvoyTunnelMessage,
2525
2677
  writeToEnvoyTunnelMessageKind,
@@ -2538,10 +2690,10 @@ export {
2538
2690
  writeToRivetPong,
2539
2691
  writeToRivetResponseChunk,
2540
2692
  writeToRivetResponseStart,
2541
- writeToRivetSqliteCommitFinalizeRequest,
2542
2693
  writeToRivetSqliteCommitRequest,
2543
- writeToRivetSqliteCommitStageBeginRequest,
2544
- writeToRivetSqliteCommitStageRequest,
2694
+ writeToRivetSqliteExecRequest,
2695
+ writeToRivetSqliteExecuteBatchRequest,
2696
+ writeToRivetSqliteExecuteRequest,
2545
2697
  writeToRivetSqliteGetPagesRequest,
2546
2698
  writeToRivetTunnelMessage,
2547
2699
  writeToRivetTunnelMessageKind,