Actions6
- Database Actions
Database → Execute Query
AI-generatedSummary
Executes SQL against the selected local SQLite database, binding values from the replacements array to 1-indexed $1, $2, … placeholders. The query runs once per input item by default; choose Transaction to run items in a transaction or Multi-Row Insert for a single insert statement (the latter applies only to the Insert operation).
Inputs
- Database File Path Override — Optional absolute path to the database file. When set, it overrides the credential’s database path and base directory.
- Database — Optional database file path relative to the credential’s base directory. Ignored when Database File Path Override is set.
- Read Only — Opens the database read-only, so SQLite rejects writes. Defaults to off.
- Confirm Destructive Operation — Allows SQL detected as DROP, TRUNCATE, or DELETE/UPDATE without a WHERE clause. Defaults to off; other arbitrary SQL can still write when Read Only is off.
- Execution Mode — Choose Independent (each input item runs separately), Transaction (items run inside a transaction and roll back on an error), or Multi-Row Insert (for Insert only). Defaults to Independent.
- Query (required) — SQL statement to execute. Use 1-indexed
$1,$2, … placeholders for bound values; a non-empty query is required. - Replacements (JSON Array) — JSON array of values for the numbered placeholders, in placeholder order. Defaults to
[].
Output shape
A list of n8n items.
Queries beginning with SELECT, WITH, PRAGMA, EXPLAIN, or VALUES return one item per row, containing that row’s columns. Other statements return a result item with
changesandlastInsertRowidfor each input item. With Continue On Fail enabled, errors are returned as items with anerrorfield; a transaction error rolls back the transaction.