Preview SQL Query Results for Parametrized queries

The SQL query preview feature is fantastic, but I wanted to know if it was possible to preview a parametrized query, i.e., a query where I have replaced some parameters with ?s in order to replace those at runtime with parameters being produced in R (e.g., looping through values and sending the same query with different filters every loop).

If I just preview the query with the ?s, I get an error saying the query needs to be bound before fetching - I would imagine that the preview is doing a dbSendQuery and a dbFetchQuery and since there is no dbBind there is no step where parameters can be bound.

Is there any way to change that?

There isn't, but this seems like a great idea to me. Would you mind filing this as a feature request at https://github.com/rstudio/rstudio/issues?

Done https://github.com/rstudio/rstudio/issues/4824

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.