Plug Database icon

Plug Database

Run Plug Database commands over REST or Socket.

Tools → Build SQL Request

AI-generated

Summary

Builds a SQL request command for a specified Plug Database agent, incorporating a SQL query with parameters, and stores the result in a JSON property for use later in the workflow.

Inputs

  • Tool Category — Select the group of related tools to display (e.g., Documents, Image, Data), defaulting to 'documents' but does not affect this operation's execution.
  • Agent ID (required) — Specify the unique identifier of the Plug Database agent for which to build the SQL request.
  • SQL (required) — Enter the SQL query string to be used in the SQL request.
  • Params JSON (required) — Provide an array of parameters in JSON format to safely parameterize the SQL query.
  • Output JSON Property — Define the JSON property name where the built SQL request command will be stored; defaults to 'sqlRequest'.

Output shape

a single JSON object representing the built SQL request command

The built command includes the agent ID, SQL string, and associated parameters, structured for execution by other Plug Database operations or nodes. The output is placed under the JSON property specified by 'Output JSON Property'.

Examples

Example 1: Build a parameterized SQL query command for agent 'agent123' selecting from a users table

Set Tool Category as desired (optional), specify 'agent123' as Agent ID, input a SQL query like 'SELECT * FROM users WHERE status = ?', provide corresponding parameters JSON array ['active'], and set Output JSON Property to 'sqlRequest'. The node outputs a JSON object under 'sqlRequest' containing the prepared SQL command and parameters ready for execution.

Links

Discussion