fmt: orm delete (#7035)
parent
a128ab4313
commit
a98162118b
|
@ -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('}')
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue