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. There is another component with the same name in the prototypes family, SQL Executor, which does the same.

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
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.
Query To Run (required)The SQL query to run.

Output

The Text output is the query result.

Example

An analyst wants the day’s order count.

  1. Type the database address in Database URL.
  2. Type in Query To Run SELECT COUNT(*) FROM orders WHERE date = CURRENT_DATE.
  3. Email Text every afternoon.

Good practices

  • The address includes the password: use a read-only user. For connections kept in credentials, use components such as Postgres SQL.