Skip to content

Commit

Permalink
fix: use DELETE FROM for consistency (#3498)
Browse files Browse the repository at this point in the history
Being consistent with [docs](https://cloud.google.com/spanner/docs/dml-syntax#delete_examples).

Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
Co-authored-by: Takashi Matsuo <[email protected]>
  • Loading branch information
3 people authored Apr 28, 2020
1 parent 4b55b54 commit 692730d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spanner/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def delete_data_with_dml(instance_id, database_id):

def delete_singers(transaction):
row_ct = transaction.execute_update(
"DELETE Singers WHERE FirstName = 'Alice'"
"DELETE FROM Singers WHERE FirstName = 'Alice'"
)

print("{} record(s) deleted.".format(row_ct))
Expand Down Expand Up @@ -1055,7 +1055,7 @@ def delete_data_with_partitioned_dml(instance_id, database_id):
database = instance.database(database_id)

row_ct = database.execute_partitioned_dml(
"DELETE Singers WHERE SingerId > 10"
"DELETE FROM Singers WHERE SingerId > 10"
)

print("{} record(s) deleted.".format(row_ct))
Expand Down

0 comments on commit 692730d

Please sign in to comment.