Pure SQL
Write standard SQL without learning a new DSL. Dependencies are automatically detected from your queries.
Transform your data with pure SQL. No ref() functions, no boilerplate - just write SQL and let LeapSQL handle the rest.
/*---
name: customers
materialized: table
---*/
SELECT
c.id,
c.name,
c.email,
COUNT(o.id) as order_count,
SUM(o.amount) as total_spent
FROM raw_customers c
LEFT JOIN raw_orders o ON c.id = o.customer_id
GROUP BY c.id, c.name, c.emailLeapSQL automatically:
raw_customers and raw_ordersorder_count comes from orders.id and total_spent from orders.amount