x <- character(0)
glue::glue_sql("{x*}")
# <SQL> NULL
When used as part of an SQL expression, this can happen:
glue::glue_sql("select foo from bar where baz in ({x*})")
# <SQL> select foo from bar where baz in (NULL)
... which has different semantics (in most SQL variants) than what I believe most users likely are intending when x is empty:
# <SQL> select foo from bar where baz in () <-- the _intended_ SQL, I think.
I've confirmed this also happens with DB object identified expansion, too, i.e.:
When used as part of an SQL expression, this can happen:
... which has different semantics (in most SQL variants) than what I believe most users likely are intending when
xis empty:# <SQL> select foo from bar where baz in () <-- the _intended_ SQL, I think.I've confirmed this also happens with DB object identified expansion, too, i.e.: