-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- example code for passwd table turned into a fxn to do one liner for table setup - use one liner setup in privileges and row policy fxn docs - rework rls_run to fetch con from query input if con not passed, also separate file -
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Run a query | ||
#' | ||
#' @export | ||
#' @param query an s3 object of class `privilege` or `row_policy, required. | ||
#' if `con` is not supplied, we attempt to get the connection | ||
#' from `query`; if it is not found we try to use a value passed to `con`. | ||
#' @param con DBI connection object, optional, see `query` | ||
#' @return error from PostgreSQL or Redshift upon error, or an integer | ||
#' value | ||
rls_run <- function(query, con = NULL) { | ||
assert_is(query, c("privilege", "row_policy")) | ||
con <- as_con(query %||% con) | ||
is_conn(con) | ||
sql <- switch(class(query), | ||
privilege = translate_privilege(query, con), | ||
row_policy = translate_row_policy(query, con) | ||
) | ||
dbExecute(con, sql) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.