Skip to content

Instantly share code, notes, and snippets.

@syossan27
Created October 17, 2020 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syossan27/9384bdb60f6ead906582679f31d668c9 to your computer and use it in GitHub Desktop.
Save syossan27/9384bdb60f6ead906582679f31d668c9 to your computer and use it in GitHub Desktop.
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