This function executes a user-defined SQL query on the Plug database, with safe query construction
using glue_sql.
Usage
plug_execute_query(
sql_template,
endpoint = "https://plug.der.pe.gov.br/MadrixApi/executeQuery",
verbosity = 0,
...
)
Arguments
- sql_template
A SQL query template with placeholders for variables.
- endpoint
The endpoint URL for executing queries.
- verbosity
The verbosity level of the API request (0 = none, 1 = minimal, 2 = detailed).
- ...
Named arguments to replace placeholders in the SQL template.
Value
A tibble containing the query results.
Examples
# \donttest{
if (FALSE) { # \dontrun{
data <- plug_execute_query(sql_template = "SELECT TOP 1 * FROM Contratos_VIEW")
} # }
# }