Skip to main content
Version: 3.4.0

sql

Insert data into a SQL database

Currently only Postgres and Sqlite (embedded) are supported.

Example

action:

sql:
source:
kind: sqlite
connection: test.db
table: person
fields:
- name
- age
- birthdate

Field NameDescriptionTypeDefault
batchMaximum number of events in an output batch. If 'document' send on end of documentinteger or the 'document'-
timeoutInterval after which the batch is sent, to keep throughput goinginterval100ms
headerPut a header line before the batchtemplated text-
footerPut a header line after the last line of the batchtemplated text-
use-document-markerEnrich the pipe metadata with a document marker (for document handling in batch mode)boolfalse
fieldsThe fields to be inserted into the tablearray of fields-
tableAn existing tablestring-
sourceSQL connection optionsOutputSqlSource-

batch

Maximum number of events in an output batch. If 'document' send on end of document

Type: integer or the 'document'

timeout

Interval after which the batch is sent, to keep throughput going

Type: interval

Put a header line before the batch

Type: templated text

Put a header line after the last line of the batch

Type: templated text

use-document-marker

Enrich the pipe metadata with a document marker (for document handling in batch mode)

Type: bool

fields

The fields to be inserted into the table

If the field does not exist in the data, the output column becomes NULL (if possible)

Type: array of fields

table

An existing table

Type: string

source

SQL connection options

Type: OutputSqlSource

Field NameDescriptionTypeDefault
kindThe type of SQL server being written tostring-
connectionA valid SQL connection string to the kind of server being connected tostring-

kind

The type of SQL server being written to

Type: string

connection

A valid SQL connection string to the kind of server being connected to

Type: string