Skip to content

Commit 692730d

Browse files
skuruppugcf-merge-on-green[bot]Takashi Matsuo
authored
fix: use DELETE FROM for consistency (GoogleCloudPlatform#3498)
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 <tmatsuo@google.com>
1 parent 4b55b54 commit 692730d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spanner/cloud-client/snippets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ def delete_data_with_dml(instance_id, database_id):
831831

832832
def delete_singers(transaction):
833833
row_ct = transaction.execute_update(
834-
"DELETE Singers WHERE FirstName = 'Alice'"
834+
"DELETE FROM Singers WHERE FirstName = 'Alice'"
835835
)
836836

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

10571057
row_ct = database.execute_partitioned_dml(
1058-
"DELETE Singers WHERE SingerId > 10"
1058+
"DELETE FROM Singers WHERE SingerId > 10"
10591059
)
10601060

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

0 commit comments

Comments
 (0)