536
536
THEN RAISE (FAIL, 'id should be text')
537
537
END;
538
538
INSERT INTO "ps_data__lists"
539
- SELECT NEW.id, json_object('description', concat (NEW."description"));
540
- INSERT INTO powersync_crud_(data) VALUES(json_object('op', 'PUT', 'type', 'lists', 'id', NEW.id, 'data', json(powersync_diff('{}', json_object('description', concat (NEW."description"))))));
539
+ SELECT NEW.id, json_object('description', powersync_strip_subtype (NEW."description"));
540
+ INSERT INTO powersync_crud_(data) VALUES(json_object('op', 'PUT', 'type', 'lists', 'id', NEW.id, 'data', json(powersync_diff('{}', json_object('description', powersync_strip_subtype (NEW."description"))))));
541
541
INSERT INTO ps_oplog(bucket, op_id, op, row_type, row_id, hash, superseded)
542
542
SELECT '$local',
543
543
1,
@@ -557,9 +557,9 @@ BEGIN
557
557
THEN RAISE (FAIL, 'Cannot update id')
558
558
END;
559
559
UPDATE "ps_data__lists"
560
- SET data = json_object('description', concat (NEW."description"))
560
+ SET data = json_object('description', powersync_strip_subtype (NEW."description"))
561
561
WHERE id = NEW.id;
562
- INSERT INTO powersync_crud_(data) VALUES(json_object('op', 'PATCH', 'type', 'lists', 'id', NEW.id, 'data', json(powersync_diff(json_object('description', concat (OLD."description")), json_object('description', concat (NEW."description"))))));
562
+ INSERT INTO powersync_crud_(data) VALUES(json_object('op', 'PATCH', 'type', 'lists', 'id', NEW.id, 'data', json(powersync_diff(json_object('description', powersync_strip_subtype (OLD."description")), json_object('description', powersync_strip_subtype (NEW."description"))))));
563
563
INSERT INTO ps_oplog(bucket, op_id, op, row_type, row_id, hash, superseded)
564
564
SELECT '$local',
565
565
1,
598
598
WHEN (typeof(NEW.id) != 'text')
599
599
THEN RAISE (FAIL, 'id should be text')
600
600
END;
601
- INSERT INTO "ps_data__lists" SELECT NEW.id, json_object('description', concat (NEW."description"));
602
- INSERT INTO powersync_crud(op,id,type,data) VALUES ('PUT',NEW.id,'lists',json(powersync_diff('{}', json_object('description', concat (NEW."description")))));
601
+ INSERT INTO "ps_data__lists" SELECT NEW.id, json_object('description', powersync_strip_subtype (NEW."description"));
602
+ INSERT INTO powersync_crud(op,id,type,data) VALUES ('PUT',NEW.id,'lists',json(powersync_diff('{}', json_object('description', powersync_strip_subtype (NEW."description")))));
603
603
END
604
604
;CREATE TRIGGER "ps_view_update_lists"
605
605
INSTEAD OF UPDATE ON "lists"
@@ -610,9 +610,9 @@ BEGIN
610
610
THEN RAISE (FAIL, 'Cannot update id')
611
611
END;
612
612
UPDATE "ps_data__lists"
613
- SET data = json_object('description', concat (NEW."description"))
613
+ SET data = json_object('description', powersync_strip_subtype (NEW."description"))
614
614
WHERE id = NEW.id;
615
- INSERT INTO powersync_crud(op,type,id,data,options) VALUES ('PATCH','lists',NEW.id,json(powersync_diff(json_object('description', concat (OLD."description")), json_object('description', concat (NEW."description")))),0);
615
+ INSERT INTO powersync_crud(op,type,id,data,options) VALUES ('PATCH','lists',NEW.id,json(powersync_diff(json_object('description', powersync_strip_subtype (OLD."description")), json_object('description', powersync_strip_subtype (NEW."description")))),0);
616
616
END
617
617
''' ;
618
618
636
636
WHEN (typeof(NEW.id) != 'text')
637
637
THEN RAISE (FAIL, 'id should be text')
638
638
END;
639
- INSERT INTO "ps_data__lists" SELECT NEW.id, json_object('description', concat (NEW."description"));
640
- INSERT INTO powersync_crud(op,id,type,data) VALUES ('PUT',NEW.id,'lists',json(powersync_diff('{}', json_object('description', concat (NEW."description")))));
639
+ INSERT INTO "ps_data__lists" SELECT NEW.id, json_object('description', powersync_strip_subtype (NEW."description"));
640
+ INSERT INTO powersync_crud(op,id,type,data) VALUES ('PUT',NEW.id,'lists',json(powersync_diff('{}', json_object('description', powersync_strip_subtype (NEW."description")))));
641
641
END
642
642
;CREATE TRIGGER "ps_view_update_lists"
643
643
INSTEAD OF UPDATE ON "lists"
@@ -648,8 +648,8 @@ BEGIN
648
648
THEN RAISE (FAIL, 'Cannot update id')
649
649
END;
650
650
UPDATE "ps_data__lists"
651
- SET data = json_object('description', concat (NEW."description"))
651
+ SET data = json_object('description', powersync_strip_subtype (NEW."description"))
652
652
WHERE id = NEW.id;
653
- INSERT INTO powersync_crud(op,type,id,data,options) VALUES ('PATCH','lists',NEW.id,json(powersync_diff(json_object('description', concat (OLD."description")), json_object('description', concat (NEW."description")))),0);
653
+ INSERT INTO powersync_crud(op,type,id,data,options) VALUES ('PATCH','lists',NEW.id,json(powersync_diff(json_object('description', powersync_strip_subtype (OLD."description")), json_object('description', powersync_strip_subtype (NEW."description")))),0);
654
654
END
655
655
''' ;
0 commit comments