Skip to content

RUST SDK How to insert an array of data with ON DUPLICATE? #5689

Closed Answered by Rushmore75
Rushmore75 asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, here's working code:

db.query("INSERT INTO website $array
ON DUPLICATE KEY UPDATE
accessed_at = time::now(),
crawled = crawled OR $input.crawled
RETURN VALUE id;
")
.bind(("array", all)).await;

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Rushmore75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant