From 6d72004f519c1402aaabb04c132b99378a26889f Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Mon, 1 Jan 2024 11:43:29 +0800 Subject: [PATCH 1/2] Update create.mdx --- docs/pages/writing-data/create.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/writing-data/create.mdx b/docs/pages/writing-data/create.mdx index e6d28866..52a6f26e 100644 --- a/docs/pages/writing-data/create.mdx +++ b/docs/pages/writing-data/create.mdx @@ -81,7 +81,7 @@ let comment: comment::Data = client .comment() .create( "content".to_string(), - // If post wasn't required, then the equals() would need + // If post wasn't required, then this would need // to be wrapped in comment::post::connect(..). post::id::equals("id".to_string()) vec![] @@ -107,9 +107,9 @@ use prisma::{comment, post}; let comment: comment::Data = client .comment() - .create( + .create_unchecked( "content".to_string(), - // requires specifying field for postID, + // requires providing value for postID foreign key, // rather than connecting a relation 0, vec![] From 5987ea85dd9dde671a598970ff384a8a47092116 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Mon, 1 Jan 2024 11:46:06 +0800 Subject: [PATCH 2/2] Update update.md --- docs/pages/writing-data/update.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/pages/writing-data/update.md b/docs/pages/writing-data/update.md index 2d3b37a8..32f1e937 100644 --- a/docs/pages/writing-data/update.md +++ b/docs/pages/writing-data/update.md @@ -60,8 +60,9 @@ use prisma::{comment, post}; let comment: comment::Data = client .comment() - .update( + .update_unchecked( comment::id::equals("some comment id".to_string()), + // can't `connect` relations, but can set foreign keys directly vec![comment::post_id::set("some post id".to_string())] ) .exec()