SQL
SQL (sql)
Execute parameterised statements against relational databases.
Database json
Minimal example
output: sql: {}JSON
{ "output": { "sql": {} }}Contents
Fields
| Field | Type | Required | Description |
|---|---|---|---|
retry Reliability | Retry | Retry policy for failed executions. | |
batch Processing | Batch | Logical batching hints shared with other outputs. | |
connection Connection | Connection | Connection details for the target database (omit when using worker_database). | |
statement Statement | multiline-text (string) | Inline SQL statement executed when statement-file is not provided. | |
statement-file Statement | path (string) | Path to a SQL file executed when statement is not provided.Examples: /path/to/file, c:\users\joe\data\file.txt | |
parameters Statement | Parameters[] | Bindings that map event fields into parameter placeholders. | |
transaction Transaction | Transaction | Optional transaction scope applied per execution. | |
result-field Result | field (string) | Event field updated with statement scalar results. Examples: data_field | |
affected-rows-field Result | field (string) | Event field populated with affected row counts. Examples: data_field | |
worker-database Connection | map (object) | Bind to a worker-managed database declared on the worker. |
Reliability
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
retry | Retry | Retry policy for failed executions. |
Processing
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
batch | Batch | Logical batching hints shared with other outputs. |
Connection
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
connection | Connection | Connection details for the target database (omit when using worker_database). | |
worker-database | map (object) | Bind to a worker-managed database declared on the worker. |
Statement
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
statement | multiline-text (string) | Inline SQL statement executed when statement-file is not provided. | |
statement-file | path (string) | Path to a SQL file executed when statement is not provided.Examples: /path/to/file, c:\users\joe\data\file.txt | |
parameters | Parameters[] | Bindings that map event fields into parameter placeholders. |
Transaction
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
transaction | Transaction | Optional transaction scope applied per execution. |
Result
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
result-field | field (string) | Event field updated with statement scalar results. Examples: data_field | |
affected-rows-field | field (string) | Event field populated with affected row counts. Examples: data_field |
Schema
- Retry Fields
- Batch Fields
- Connection Fields
- Parameters Fields
- Transaction Fields
- Batch - Mode Options
- Transaction - Mode Options
Retry Fields
| Field | Type | Required | Description |
|---|---|---|---|
timeout | time-interval (string) | ✅ | timeout (e.g. 500ms, 2s etc. - default is 30). Examples: 500ms, 2h |
retries | number (integer) | number of retries. Examples: 42, 1.2e-10 |
Batch Fields
| Field | Type | Required | Description |
|---|---|---|---|
fixed-size | number (integer) | maximum number of events in an output batch. Examples: 42, 1.2e-10 | |
mode | Mode | ✅ | If ‘document’ send on end of document generated by input. If ‘fixed’, use fixed_size.Allowed values: fixed, document |
timeout | time-interval (string) | ✅ | interval after which the batch is sent, to keep throughput going (default 100ms). Examples: 500ms, 2h |
header | multiline-text (string) | put a header line before the batch. | |
footer | multiline-text (string) | put a header line after the last line of the batch. | |
use-document-marker | boolean (bool) | Enrich the job metadata with a document marker (for document handling in batch mode). | |
wrap-as-json | boolean (bool) | Format the output batch as a JSON array. |
Connection Fields
| Field | Type | Required | Description |
|---|---|---|---|
url | url (string) | ✅ | Database connection URL (sqlx/ODBC compatible). Examples: https://example.com/path |
max-connections | number (integer) | Maximum size of the async connection pool. Examples: 42, 1.2e-10 | |
min-connections | number (integer) | Minimum number of connections retained in the pool. Examples: 42, 1.2e-10 | |
connect-timeout | string | Optional connection timeout (humantime duration string). | |
idle-timeout | string | Optional idle timeout (humantime duration string). | |
schema | string | Optional schema override applied after connect. | |
options | string[] | Statements executed after connect (e.g. SET search_path TO …). | |
disable-tls-verification | boolean (bool) | Skip TLS verification (development only). |
Parameters Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | |
field | string | ✅ | |
default | multiline-text (string) |
Transaction Fields
| Field | Type | Required | Description |
|---|---|---|---|
mode | Mode | Allowed values: none, per-event, per-batch, document | |
isolation-level | string | ||
access-mode | string | ||
deferrable | boolean (bool) |
Batch - Mode Options
| Value | Description |
|---|---|
fixed | Fixed |
document | Document |
Transaction - Mode Options
| Value | Description |
|---|---|
none | None |
per-event | Per Event |
per-batch | Per Batch |
document | Document |