Skip to content

Commit 8cf3cba

Browse files
committed
update checks for inserting new rows
1 parent 024fda8 commit 8cf3cba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/core/src/views.rs

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ fn powersync_trigger_insert_sql_impl(
154154
SELECT CASE
155155
WHEN (NEW.id IS NULL)
156156
THEN RAISE (FAIL, 'id is required')
157+
WHEN (typeof(NEW.id) != 'text')
158+
THEN RAISE (FAIL, 'id should be text')
157159
END;
158160
INSERT INTO {:}
159161
SELECT NEW.id, {:};

0 commit comments

Comments
 (0)