UPDATE Statements
Basic UPDATE
Section titled “Basic UPDATE”Update existing records using filter and set:
update User filter id = 1 set { name := "Alice Smith"}
-- Transpiled SQLUPDATE User SET name = 'Alice Smith' WHERE id = 1Update Multiple Fields
Section titled “Update Multiple Fields”update User filter id = 1 set { name := "Alice Smith", email := "alice.smith@example.com", updated_at := "2024-01-15"}
-- Transpiled SQLUPDATE UserSET name = 'Alice Smith', email = 'alice.smith@example.com', updated_at = '2024-01-15'WHERE id = 1Update with Complex Filter
Section titled “Update with Complex Filter”update Product filter category = "Electronics" set { on_sale := true}
-- Transpiled SQLUPDATE Product SET on_sale = true WHERE category = 'Electronics'Update All Records
Section titled “Update All Records”update User set { newsletter := false}
-- Transpiled SQLUPDATE User SET newsletter = false