glue
                                
                                
                                
                                    glue copied to clipboard
                            
                            
                            
                        glue_sql converts length-0 vectors to NULL in asterisk-expansion
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.:
"{`x`*}"
# <SQL> NULL