Cross-parse from an R parse tree into SQL.

tokenize_for_SQL(lexpr, colnames, env = parent.frame())

Arguments

lexpr

item from substitute

colnames

column names of table

env

environment to look for values

Value

sql info: list(presentation, parsed_toks(list of tokens), sql_text, symbols_used, symbols_produced, free_symbols)

Examples

tokenize_for_SQL(substitute(1 + 2), colnames= NULL)
#> $presentation #> [1] "1 + 2" #> #> $parsed_toks #> 1 + 2 #> $symbols_used #> character(0) #> #> $symbols_produced #> character(0) #> #> $free_symbols #> character(0) #>
tokenize_for_SQL(substitute(a := 3), colnames= NULL)
#> $presentation #> [1] "a := 3" #> #> $parsed_toks #> [1] "3" #> #> $symbols_used #> character(0) #> #> $symbols_produced #> [1] "a" #> #> $free_symbols #> character(0) #>
tokenize_for_SQL(substitute(a %:=% ( 3 + 4 )), colnames= NULL)
#> $presentation #> [1] "a %:=% (3 + 4)" #> #> $parsed_toks #> ( 3 + 4 ) #> $symbols_used #> character(0) #> #> $symbols_produced #> [1] "a" #> #> $free_symbols #> character(0) #>