Skip to content

INSERT Statements

Insert new records using the shape syntax with := assignments:

insert User {
name := "Alice",
email := "alice@example.com",
active := true
}
-- Transpiled SQL
INSERT INTO User (name, email, active)
VALUES ('Alice', 'alice@example.com', true)
insert Product {
name := "Widget", -- String (use double quotes)
price := 99, -- Integer
in_stock := true, -- Boolean
quantity := 0
}
TypeExampleNotes
String"hello"Double quotes
Integer42, 0, -10Whole numbers
Booleantrue, falseCase-sensitive
insert Order {
user_id := 1,
product_id := 42,
quantity := 2,
total := 198,
status := "pending",
created_at := "2024-01-15"
}
-- Transpiled SQL
INSERT INTO Order (user_id, product_id, quantity, total, status, created_at)
VALUES (1, 42, 2, 198, 'pending', '2024-01-15')