Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update create.mdx #424

Merged
merged 2 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/pages/writing-data/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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![]
Expand All @@ -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![]
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/writing-data/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading