Skip to content

Commit 87b9882

Browse files
committed
Use DELETE FROM instead of DELETE
1 parent 19fbca9 commit 87b9882

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Items of the DSL:
4848
* `returning(col1, col2, ...)` equivalent to `RETURNING col1, col2`.
4949
* `update(table)` - equivalent to `UPDATE table`. Must be followed by `set`
5050
* `set(Sets)` - equivalent to `SET Col1 = Val1, ...`. Similar to WHERE but only = is allowed. Optionally, you can add a `where+` after a `set`.
51-
* `delete(table)` - equivalent to `DELETE table`. Must be followed by `where`.
51+
* `delete(table)` - equivalent to `DELETE FROM table`. Must be followed by `where`.
5252

5353
Examples:
5454

sql_query.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
% DELETE
330330

331331
sql_query_delete([delete(Table)|Rest], Vars) -->
332-
"DELETE ",
332+
"DELETE FROM ",
333333
format_("~w", [Table]),
334334
" ",
335335
sql_query_delete_where(Rest, Vars).

tests.lgt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
test(sql_query_delete) :-
142142
sql_query:sql_query(
143143
[delete(post),where(lang = "fr")],
144-
"DELETE post WHERE lang = $1",
144+
"DELETE FROM post WHERE lang = $1",
145145
[1-"fr"]
146146
).
147147

0 commit comments

Comments
 (0)