I’m writing a function and I wanted to paste a list typed by user to filters in WHERE. List typed to function by user:
filters = list( ‘fruits’ = c(‘apple’,’orange’),
‘vegetables’ = ‘carrot’)
How to paste this list to sql query in glue sql:
df = glue_sql(“select …
where filters)
More dynamic, allowing a singular
"!"operator to negate equality/set-membership.The negation is based solely on the presence of the
"!"literal in a vector. (Anything more complex and you might as well adopt mongo's json-structured query language ... not something I'm eager to re-implement.)