| name | ebuilder-sql-query-pre-pipeline |
| description | Pre-pipeline playbook for query-* definitions in configs/sql.*.yml. USE FOR: query.<name>.pre steps, setup/validation preload flow, jsExpression preparation, and command-omitted query behavior. DO NOT USE FOR: post-processing behavior. |
eBuilder Query Pre Pipeline
Purpose
Use this skill when designing pre steps for a query.
Scope
- Preload context before
command.
- Validate access and input-derived constraints.
- Prepare computed params using
jsExpression.
Execution Behavior
pre runs before command.
- When
command exists, pre participates in the same query execution flow.
- If
command is omitted, the last pre step result becomes the query result.
Typical Step Uses
- Permission checks via
query step.
- Data enrichment via
query step.
- Param normalization via
jsExpression.
- Delegated logic via
task step.
Example
query:
query-items-with-paging:
datasource: main
responseType: list
pre:
- key: paging
jsExpression: |
${{
const pageNum = ${pageNum} || 1;
const pageSize = Math.min(${pageSize} || 10, 100);
const offset = (pageNum - 1) * pageSize;
return { offset, pageSize };
}}
command: |
SELECT id AS "id", title AS "title"
FROM items
ORDER BY id DESC
OFFSET ${paging___offset}
LIMIT ${paging___pageSize}
Deterministic Checks
pre step keys are unique and meaningful.
jsExpression always returns an explicit object/value.
- Derived values are referenced with correct step-output syntax.
- If
command is omitted, final pre result shape matches response expectations.
pre is used for setup/validation only, not hidden mutations.