Created
November 22, 2018 01:51
-
-
Save shumon84/a4761152f440845fa3f3544a347915a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stmt1, _ := db.Prepare("INSERT INTO hoge (id) VALUES (?)") | |
tx, err := db.Begin() // トランザクション開始 | |
stmt2 := tx.Stmt(stmt1) | |
stmt1.Exec("0000") // トランザクションに含まれない | |
stmt2.Exec("0000") // トランザクションに含まれる | |
tx.Commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment