steampipe icon indicating copy to clipboard operation
steampipe copied to clipboard

Variables in Batch Queries

Open artemklevtsov opened this issue 7 months ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe.

Add CLI parameter --variable to interpolate in the SQL query. Like psql --variable.

Describe the solution you'd like

SELECT *
  FROM jira_issue AS ji
 WHERE AND ji.updated >= $1
steampipe query -v '2025-01-01' jira.sql

Describe alternatives you've considered

As workaround start steampipe service and use psql or usql.

Additional context

Steampipe v1.1.0.

artemklevtsov avatar Apr 18 '25 04:04 artemklevtsov

Hey @artemklevtsov, thanks for the feature request.

However, the support for passing of variables to batch queries has not been added intentionally. Since we can run multiple SQL files or SQL statements in the steampipe batch query, it would be difficult to specify the variables. (We can run multiple sql queries by passing multiple sql files/queries - e.g. steampipe query jira1.sql jira2.sql)

pskrbasu avatar Apr 18 '25 09:04 pskrbasu

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jun 18 '25 08:06 github-actions[bot]