Output · Databases and cloud

Write to DB

Loads the table into PostgreSQL or MySQL through a saved connection, or into a SQLite file. Stop if the table exists, replace it, or append rows.

Also known as: Insert, output to database

How it works

Pick a Target: PostgreSQL (the default), MySQL or SQLite. For PostgreSQL and MySQL choose a Database credential saved in the vault; the connection details are never stored in the project. For SQLite the node writes a Database file (output.sqlite by default) at the chosen Location, the project folder unless you pick another. Type the target Table name. Write mode is Fail if exists by default, which stops when the table already exists and writes nothing; Append adds the rows to the existing table; Replace drops it and writes the table afresh.

Inputs and outputs

Inputs

  • data — Table

Outputs

None — this node starts a workflow.

Settings

The Attributes panel of Write to DB, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  target: "postgres"|"mysql"|"sqlite"
  credentialName?: string
  fileName?: string
  directory?: string
  table: string
  mode: "fail"|"append"|"replace"
}

"fail" stops if the table exists, "replace" overwrites it, "append" adds rows. An unrecognised mode falls back to "fail", which writes nothing.

Example

A nightly pipeline refreshes a reporting table in PostgreSQL. Set Target to PostgreSQL, pick the warehouse credential, Table to daily_sales and Write mode to Replace. For a log that grows each run, use Append instead.