Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom params in function that use get_package_scope_var, default to said package_scope_var #161

Open
1 task
ChemiKyle opened this issue Jun 15, 2023 · 0 comments

Comments

@ChemiKyle
Copy link
Contributor

We should give users (and ourselves) the ability to override function variables that use get_package_scope_var, namely DB connection objects so that we can easily use in-memory databases while testing, rather than having to load a separate .env file for testing.

Updates would follow this template:

foo <- function(
...,
+db_conn = NULL
) {
- db_conn <- get_package_scope_var("db_conn")
+  if (is.null(db_conn)) {
+    db_conn <- get_package_scope_var("db_conn")
+  }
...
}

Relevant places that get_package_scope_var is called:

https://github.com/search?q=repo%3Actsit/rcc.billing%20get_package_scope_var&type=code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant