Skip to content

[Connector] Add bound-parameter support to databricks/execute_sql #150

Description

@michaelmcnees

Background

The Databricks SQL Statements API supports named parameters — callers can pass {{param_name}} placeholders in the SQL and a parameters array in the request body:

{
  "statement": "SELECT * FROM users WHERE id = :id",
  "parameters": [{"name": "id", "value": "42", "type": "INT"}]
}

This is different from the ?/$N placeholder approach used by the other SQL connectors (MySQL, MSSQL, Redshift, Snowflake) which pass args via database/sql's variadic QueryContext.

Proposed change

Add an optional parameters param to DatabricksExecuteSQLConnector.Execute:

- action: databricks/execute_sql
  params:
    warehouse_id: "..."
    statement: "SELECT * FROM orders WHERE user_id = :user_id AND status = :status"
    parameters:
      - name: user_id
        value: "{{ inputs.user_id }}"
        type: STRING
      - name: status
        value: active
        type: STRING

The parameters array should be passed through to the Databricks API payload as-is (after type-asserting each entry as map[string]any). No driver-level escaping is needed — Databricks handles parameterization server-side.

Files

  • packages/engine/internal/connector/databricks.goDatabricksExecuteSQLConnector.Execute
  • packages/engine/internal/connector/databricks_test.go — add a test asserting the parameters field is included in the request body

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions