diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index bc9fd3c3ee..a469c1402d 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -471,7 +471,9 @@ pub fn (mut f Fmt) stmt(node ast.Stmt) { f.writeln('') } .delete { - // TODO delete + f.write('\tdelete from ${util.strip_mod_name(node.table_name)} where ') + f.expr(node.where_expr) + f.writeln('') } } f.writeln('}') diff --git a/vlib/v/fmt/tests/orm_keep.vv b/vlib/v/fmt/tests/orm_keep.vv index 33c5a7917a..ca4a56ebbe 100644 --- a/vlib/v/fmt/tests/orm_keep.vv +++ b/vlib/v/fmt/tests/orm_keep.vv @@ -42,4 +42,8 @@ fn main() { sql db { insert new_customer into Customer } + // delete a row + sql db { + delete from Customer where nr_orders == 10 && name == 'Bob' + } }