Created
October 17, 2020 07:16
-
-
Save syossan27/9384bdb60f6ead906582679f31d668c9 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
func deleteAllRows(ctx context.Context, db *spanner.Client, tableName string) { | |
stmt := spanner.Statement{ | |
SQL: "DELETE FROM `" + tableName + "` WHERE true", | |
} | |
_, err := db.PartitionedUpdate(ctx, stmt) | |
if err != nil { | |
panic(err) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment