fmt: orm delete (#7035)

pull/7050/head
Lukas Neubert 2020-11-30 14:02:36 +01:00 committed by GitHub
parent a128ab4313
commit a98162118b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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('}')

View File

@ -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'
}
}