Skip to main content
The SQL Layer is the live SQL transformation surface in MantrixFlow. Open the Destination panel and select the SQL Layer tab.

Source reference

Use source() references to read staged source data:
{{ source('raw', 'public__orders') }}
The source stream public.orders becomes the raw staging table public__orders.

Example model

SELECT
  id,
  customer_id,
  LOWER(order_status) AS order_status,
  total_amount,
  created_at,
  updated_at
FROM {{ source('raw', 'public__orders') }}
WHERE order_status IS NOT NULL
Set the final delivery table to analytics.orders_live.

Validation

Use Validate SQL to check the model before saving. Use Preview output to stage a small sample and inspect the model result. MantrixFlow validates the output against the final destination table. A column that appears in the model output but not in the destination table fails with a named column error.

Delivery

The model output is delivered to the exact schema.table you enter in the Destination panel. The final table must already exist in PostgreSQL. greSQL.