Stage Category: APPLY (Enriches documents)Transformation: N documents → N documents (with SQL data added)
When to Use
When NOT to Use
Parameters
Supported Databases
A connection to any other provider fails with
Connection does not support SQL queries. For Snowflake or another warehouse, use the API Call stage against an endpoint that runs the query. See Join Warehouse Metrics onto Results.
Configuration Examples
Query Syntax
Parameter Placeholders
Use$1, $2, and so on for placeholders. The stage sorts the keys of parameters in alphabetical order and binds their values to the placeholders in that order. $1 takes the first key alphabetically.
parameters set to {"user_id": "...", "status": "active"}, $1 is status and $2 is user_id. The database binds the values, so they are not concatenated into the query text.
Template Variables
Output Schema
Single Row (default)
Multiple Rows
No Results
Security
Performance
Common Pipeline Patterns
Search + SQL Enrichment
Join Warehouse Metrics onto Results
A creative library often carries an ID such ascreative_id that keys a metrics table. The table holds spend, ROAS, and thumb-stop rate. Two stages join that table onto search results. Where the table lives picks the stage.
Both stages run after the search stage and add fields to each returned document. They do not change which documents were retrieved or how they scored. A search cannot rank by a joined value. To rank by ROAS, ingest it as document data.
From PostgreSQL
Readcreative_id from the document metadata and bind it to $1.
warehouse_metrics object. A creative with no row gets null, because on_no_results defaults to null.
From Another Warehouse
Put an HTTP endpoint in front of the warehouse. The endpoint takes the ID in its path and returns one JSON object. The stage reads the token from an organization secret. See API Call.Error Handling
Related
- Document Enrich - Collection-based joins
- API Call - REST API enrichment
- JSON Transform - Transform enriched data

