How to use Transaction in Rust? #1671
Unanswered
PhanDungTri
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The example of the
transaction
method on the doc.rs site just shows how to begin and end a transaction, so I think I should put every SQL execution inside these. Example:But the console only shows the following debug message from
surrealdb
:Executing: CREATE task SET title = $title, due_date = $due_date, create_at = time::now()
. The transaction is never complete (commit).When I get rid of the transaction, the SQL statement is executed normally and the console shows the value of
res
.What is the right way to use
Transaction
?Beta Was this translation helpful? Give feedback.
All reactions