Skip to content

SQL Executor

SQL Executor connects to a database with its connection address and runs the SQL query you give it. It returns the result as text.

When to use it

  • Running a query a model generated from a question.
  • Running a one-off query without setting up a credential.

Configuration

FieldWhat it does
Query (required)The SQL query to run.
Database URL (required)The database connection address, with user and password, for example postgresql://user:password@server:5432/sales.
Include ColumnsIncludes column names in the result. Off by default.
PassthroughIf the query fails, returns the query instead of stopping the flow. Off by default.
Add ErrorWith Passthrough on, also adds the error to the result. Off by default.

Output

The output is the query result as text.

Example

An analyst wants to ask about sales in natural language.

  1. Connect Natural Language to SQL to turn the question into a query.
  2. Pass the query to Query and type the database address in Database URL.
  3. Show the result in the chat.

Good practices

  • The address includes the password: use a read-only user. For connections kept in credentials, use components such as Postgres SQL.
  • SQLDatabase: prepares a connection to query in natural language.