Format outpack query for displaying to users. It will typically be easier to use the format method of outpack_query objects.

outpack_query_format(query, subquery = NULL)

Arguments

query

The outpack query to print

subquery

Optionally a named list of subqueries - if given, each must be a valid deparseable subquery (i.e., a literal or language object). Note that you must not provide an already-deparsed query here or it will get quoted!

Value

Query expression as a string

Examples

outpack::outpack_query_format(quote(name == "example"))
#> [1] "name == \"example\""
outpack::outpack_query_format(
  quote(usedby({A})),
  subquery = list(A = quote(latest(name == "a"))))
#> [1] "usedby({latest(name == \"a\")})"

format(outpack::outpack_query("latest", name = "a"))
#> [1] "latest(name == \"a\")"