Skip to content

Commit 2e66e51

Browse files
authored
fix: use DELETE FROM for consistency (GoogleCloudPlatform#1093)
Being consistent with [docs](https://cloud.google.com/spanner/docs/dml-syntax#delete_examples).
1 parent 70efc5c commit 2e66e51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spanner/src/delete_data_with_dml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function delete_data_with_dml($instanceId, $databaseId)
4141

4242
$database->runTransaction(function (Transaction $t) use ($spanner) {
4343
$rowCount = $t->executeUpdate(
44-
"DELETE Singers WHERE FirstName = 'Alice'");
44+
"DELETE FROM Singers WHERE FirstName = 'Alice'");
4545
$t->commit();
4646
printf('Deleted %d row(s).' . PHP_EOL, $rowCount);
4747
});

spanner/src/delete_data_with_partitioned_dml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function delete_data_with_partitioned_dml($instanceId, $databaseId)
5050
$database = $instance->database($databaseId);
5151

5252
$rowCount = $database->executePartitionedUpdate(
53-
"DELETE Singers WHERE SingerId > 10"
53+
"DELETE FROM Singers WHERE SingerId > 10"
5454
);
5555

5656
printf('Deleted %d row(s).' . PHP_EOL, $rowCount);

0 commit comments

Comments
 (0)