Skip to content

SQL

SQL (sql)

Execute parameterised statements against relational databases.

Database json

Minimal example

output:
sql: {}
JSON
{
"output": {
"sql": {}
}
}

Contents

Fields

FieldTypeRequiredDescription
retry ReliabilityRetryRetry policy for failed executions.
batch ProcessingBatchLogical batching hints shared with other outputs.
connection ConnectionConnectionConnection details for the target database (omit when using worker_database).
statement Statementmultiline-text (string)Inline SQL statement executed when statement-file is not provided.
statement-file Statementpath (string)Path to a SQL file executed when statement is not provided.
Examples: /path/to/file, c:\users\joe\data\file.txt
parameters StatementParameters[]Bindings that map event fields into parameter placeholders.
transaction TransactionTransactionOptional transaction scope applied per execution.
result-field Resultfield (string)Event field updated with statement scalar results.
Examples: data_field
affected-rows-field Resultfield (string)Event field populated with affected row counts.
Examples: data_field
worker-database Connectionmap (object)Bind to a worker-managed database declared on the worker.

Reliability

Show fields
FieldTypeRequiredDescription
retryRetryRetry policy for failed executions.

Processing

Show fields
FieldTypeRequiredDescription
batchBatchLogical batching hints shared with other outputs.

Connection

Show fields
FieldTypeRequiredDescription
connectionConnectionConnection details for the target database (omit when using worker_database).
worker-databasemap (object)Bind to a worker-managed database declared on the worker.

Statement

Show fields
FieldTypeRequiredDescription
statementmultiline-text (string)Inline SQL statement executed when statement-file is not provided.
statement-filepath (string)Path to a SQL file executed when statement is not provided.
Examples: /path/to/file, c:\users\joe\data\file.txt
parametersParameters[]Bindings that map event fields into parameter placeholders.

Transaction

Show fields
FieldTypeRequiredDescription
transactionTransactionOptional transaction scope applied per execution.

Result

Show fields
FieldTypeRequiredDescription
result-fieldfield (string)Event field updated with statement scalar results.
Examples: data_field
affected-rows-fieldfield (string)Event field populated with affected row counts.
Examples: data_field

Schema

Retry Fields

FieldTypeRequiredDescription
timeouttime-interval (string)timeout (e.g. 500ms, 2s etc. - default is 30).
Examples: 500ms, 2h
retriesnumber (integer)number of retries.
Examples: 42, 1.2e-10

Batch Fields

FieldTypeRequiredDescription
fixed-sizenumber (integer)maximum number of events in an output batch.
Examples: 42, 1.2e-10
modeModeIf ‘document’ send on end of document generated by input. If ‘fixed’, use fixed_size.
Allowed values: fixed, document
timeouttime-interval (string)interval after which the batch is sent, to keep throughput going (default 100ms).
Examples: 500ms, 2h
headermultiline-text (string)put a header line before the batch.
footermultiline-text (string)put a header line after the last line of the batch.
use-document-markerboolean (bool)Enrich the job metadata with a document marker (for document handling in batch mode).
wrap-as-jsonboolean (bool)Format the output batch as a JSON array.

Connection Fields

FieldTypeRequiredDescription
urlurl (string)Database connection URL (sqlx/ODBC compatible).
Examples: https://example.com/path
max-connectionsnumber (integer)Maximum size of the async connection pool.
Examples: 42, 1.2e-10
min-connectionsnumber (integer)Minimum number of connections retained in the pool.
Examples: 42, 1.2e-10
connect-timeoutstringOptional connection timeout (humantime duration string).
idle-timeoutstringOptional idle timeout (humantime duration string).
schemastringOptional schema override applied after connect.
optionsstring[]Statements executed after connect (e.g. SET search_path TO …).
disable-tls-verificationboolean (bool)Skip TLS verification (development only).

Parameters Fields

FieldTypeRequiredDescription
namestring
fieldstring
defaultmultiline-text (string)

Transaction Fields

FieldTypeRequiredDescription
modeModeAllowed values: none, per-event, per-batch, document
isolation-levelstring
access-modestring
deferrableboolean (bool)

Batch - Mode Options

ValueDescription
fixedFixed
documentDocument

Transaction - Mode Options

ValueDescription
noneNone
per-eventPer Event
per-batchPer Batch
documentDocument