INSERT Statements
Basic INSERT
Section titled “Basic INSERT”Insert new records using the shape syntax with := assignments:
insert User { name := "Alice", email := "alice@example.com", active := true}
-- Transpiled SQLINSERT INTO User (name, email, active)VALUES ('Alice', 'alice@example.com', true)Data Types
Section titled “Data Types”insert Product { name := "Widget", -- String (use double quotes) price := 99, -- Integer in_stock := true, -- Boolean quantity := 0}| Type | Example | Notes |
|---|---|---|
| String | "hello" | Double quotes |
| Integer | 42, 0, -10 | Whole numbers |
| Boolean | true, false | Case-sensitive |
Multiple Fields
Section titled “Multiple Fields”insert Order { user_id := 1, product_id := 42, quantity := 2, total := 198, status := "pending", created_at := "2024-01-15"}
-- Transpiled SQLINSERT INTO Order (user_id, product_id, quantity, total, status, created_at)VALUES (1, 42, 2, 198, 'pending', '2024-01-15')