Skip to content

Commit

Permalink
fix broken link dplyr::build_sql - bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
bart6114 committed Jul 3, 2017
1 parent 39e7c17 commit d4c2423
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: infuser
Type: Package
Title: A Very Basic Templating Engine
Version: 0.2.6
Date: 2017-03-14
Version: 0.2.7
Date: 2017-07-03
Author: Bart Smeets
Maintainer: Bart Smeets <bartsmeets86@gmail.com>
Description: Replace parameters in strings and/or text files with specified
Expand All @@ -13,7 +13,7 @@ Suggests:
testthat,
knitr,
rmarkdown,
dplyr,
dbplyr,
magrittr
URL: https://github.com/bart6114/infuser/
BugReports: https://github.com/bart6114/infuser/issues
Expand Down
2 changes: 1 addition & 1 deletion R/core.R
Expand Up @@ -6,7 +6,7 @@
#' Infuse a template with values.
#'
#' For more info and usage examples see the README on the \href{https://github.com/Bart6114/infuser}{\code{infuser} github page}.
#' To help prevent \href{https://xkcd.com/327/}{SQL injection attacks} (or other injection attacks), use a transformation function to escape special characters and provide it through the \code{transform_function} argument. \code{\link[dplyr]{build_sql}} is a great default escaping function for SQL templating. For templating in other languages you will need to build/specify your own escaping function.
#' To help prevent \href{https://xkcd.com/327/}{SQL injection attacks} (or other injection attacks), use a transformation function to escape special characters and provide it through the \code{transform_function} argument. \code{\link[dbplyr]{build_sql}} is a great default escaping function for SQL templating. For templating in other languages you will need to build/specify your own escaping function.
#'
#' @param file_or_string the template file or a character string containing the template
#' @param ... different keys with related values, used to fill in the template (if first passed item is a list/environment the contents of this will be processed instead)
Expand Down
8 changes: 6 additions & 2 deletions README.Rmd
Expand Up @@ -147,11 +147,11 @@ my_transform_function<-function(v){
infuse(sql, name = name, transform_function = my_transform_function)
```

Of course you can also use functions from other packages. Specifically for SQL I advise you to take a look at the ```dplyr::build_sql``` function.
Of course you can also use functions from other packages. Specifically for SQL I advise you to take a look at the ```dbplyr::build_sql``` function.


```{r}
infuse(sql, name = name, transform_function = dplyr::build_sql)
infuse(sql, name = name, transform_function = dbplyr::build_sql)
```

## Issues / questions
Expand All @@ -161,6 +161,10 @@ Simply create a new issue at this GitHub repository.

## Changes

### v.0.2.7

- change `dpyr::build_sql` to `dbplyr::build_sql`

### v.0.2.6
- set `readLines`'s `warn` parameter to `FALSE`

Expand Down
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -171,9 +171,9 @@ function.
## INSERT INTO Students (Name) VALUES ('Robert''); DROP TABLE Students;--')

Of course you can also use functions from other packages. Specifically
for SQL I advise you to take a look at the `dplyr::build_sql` function.
for SQL I advise you to take a look at the `dbplyr::build_sql` function.

infuse(sql, name = name, transform_function = dplyr::build_sql)
infuse(sql, name = name, transform_function = dbplyr::build_sql)

## INSERT INTO Students (Name) VALUES ('Robert''); DROP TABLE Students;--')

Expand All @@ -185,6 +185,10 @@ Simply create a new issue at this GitHub repository.
Changes
-------

### v.0.2.7

- change `dpyr::build_sql` to `dbplyr::build_sql`

### v.0.2.6

- set `readLines`'s `warn` parameter to `FALSE`
Expand All @@ -199,8 +203,8 @@ Changes

### v.0.2.2

- dropped `key_value_list` parameter (will be
interpreted automatically)
- dropped `key_value_list` parameter (will be interpreted
automatically)
- fixed passing of the `variable_identifier`
- ability to make `variable_identifier` persistent

Expand Down
2 changes: 1 addition & 1 deletion man/infuse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/getting_started.Rmd
Expand Up @@ -150,9 +150,9 @@ my_transform_function<-function(v){
infuse(sql, name = name, transform_function = my_transform_function)
```

Of course you can also use functions from other packages. Specifically for SQL I advise you to take a look at the `dplyr::build_sql` function.
Of course you can also use functions from other packages. Specifically for SQL I advise you to take a look at the `dbplyr::build_sql` function.


```{r}
infuse(sql, name = name, transform_function = dplyr::build_sql)
infuse(sql, name = name, transform_function = dbplyr::build_sql)
```

0 comments on commit d4c2423

Please sign in to comment.