Skip to content

Commit

Permalink
use rlangs eval parse for possible benefits
Browse files Browse the repository at this point in the history
  • Loading branch information
daranzolin committed Jun 17, 2024
1 parent 643756f commit 2c7c49a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/source_sql_to_dataframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source_sql_to_dataframe <- function(path, query_params = NULL) {

connection_string <- stringr::str_extract(readr::read_lines(path, n_max = 1), "(?<=\\=).*")
connection_call <- paste0("con <- ", connection_string)
eval(parse(text = connection_call))
rlang::eval_bare(rlang::parse_expr(connection_call))
on.exit(DBI::dbDisconnect(con))
open <- sqltargets_option_get("sqltargets.glue_sql_opening_delimiter")
close <- sqltargets_option_get("sqltargets.glue_sql_closing_delimiter")
Expand Down

0 comments on commit 2c7c49a

Please sign in to comment.