Skip to content
Docs

Database Select

Database Select runs a SQL SELECT against an external database (PostgreSQL, MySQL/MariaDB or SQL Server) and emits the matching rows as a JSON array. For everything that is not a SELECT (DDL, INSERT, UPDATE, DELETE) use Database Execute. You find it on the node picker’s Storage shelf.

The node connects with a secret of type Database credentials. Create one under Connections → Secrets first; see Secrets.

The Database Select node's settings form, with the fields described below
The Database Select node's settings form, with the fields described below
FieldTypeDefaultDescription
Secret credential (secretCredentialId)string ✦ (required) — The database credentials to connect with, chosen from your secrets.
Extra credentials (extraCredentials)key-value map (optional) — Extra connection settings merged on top of the chosen secret’s config.
Query (query)string ✦ (required) — The SELECT query to run; the matching rows are returned as the node output.
Parameters (parameters)key-value map (optional) — Named parameters bound into the query’s placeholders.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

extraCredentials entries are merged into the connection config as written and are not expression-resolved, so a flow cannot pick its database server from the payload it was started with. Use a separate secret per server instead. To choose the credentials at runtime, switch the credentials field to expression mode and resolve the id of a credential secret from flow data.

The node emits a JSON array of row objects:

[
{ "id": 1, "name": "Alice", "email": "alice@example.com" },
{ "id": 2, "name": "Bob", "email": "bob@example.com" }
]

An empty result set returns [].

An Agent can call this node as a tool; as a read-only tool it runs without pausing for approval.

The Database / Select template in the template gallery creates a smoke_customers table, seeds a row, and selects it back with a bound parameter:

SELECT id, name, email FROM smoke_customers WHERE id = :id
parameters:
id → {{ $prev->id }}