Coginiti icon

Coginiti

Interact with Coginiti API (Catalog, Execute, Identity Management)

Execute → Execute SQL

AI-generated

Summary

Execute a SQL query directly against a specified database connection, optionally overriding connection settings and providing query parameters, and retrieve the result set in JSON, CSV, or Apache Arrow format.

Inputs

  • Connection Name (required) — Name of the database connection to use for executing the query.
  • Connection Overrides — Optional connection settings to override defaults for this SQL execution, such as database or schema.
  • SQL Query (required) — The SQL query string to execute.
  • Parameters Mode (required) — Select how to specify parameters to pass into the SQL query: either manually as key/value assignments or as a JSON object.
  • Parameters — Parameters to pass into the SQL query. Provided either manually (key/value pairs) or as JSON object depending on 'Parameters Mode'. Parameter names may use $ or $$ prefixes.
  • Response Format (required) — Format of the returned query result data: JSON, CSV, or Apache Arrow.
  • Project Version — Optional project version for @Project Hub assets; if omitted, the latest version is used.

Output shape

a single JSON object, CSV text, or binary Apache Arrow file depending on 'Response Format'

The output contains the query results formatted as specified. For JSON, the data is returned as parsed JSON. For CSV, the data is returned as a CSV string in a JSON field. For Apache Arrow, the binary file is returned in the node's binary data. The operation returns a single result set from the direct SQL execution.

Examples

Example 1: Run a SQL query manually with parameter assignments and get JSON results

Specify the connection name, enter an SQL query with placeholders, set Parameters Mode to Manual, provide parameters as key-value pairs, and choose JSON as Response Format.

Example 2: Run a SQL query with JSON parameters and get CSV results

Specify the connection name, enter an SQL query with placeholders, set Parameters Mode to JSON, provide parameters as a JSON object, and choose CSV as Response Format.

Links

Discussion