stringr
stringr copied to clipboard
using a where clause on a list with str_glue
is it possible to use str_glue and have a WHERE clause on a list?
For example if my_list = c('apple', 'pear'),
how can i write the clause using
str_glue("select * from my_table where fruit in {my_list};")
without having to create the concatenated string myself with
my_list_str <- paste0("'", my_list, "'", collapse = ", ")?
Would it be possible to have the same syntax as there is in glue::glue_sql? ie using ({my_list*})?