Skip to content

dots in sql(...) should be evaluated locally #952

@mgirlich

Description

@mgirlich

Currently they are translated but I don't see why you would want that. Instead, it makes it more difficult to create SQL programmatically.

library(dbplyr)
library(dplyr, warn.conflicts = FALSE)

lazy_frame(x = 1) %>% 
  mutate(x = sql(paste0("x")))
#> <SQL>
#> SELECT CONCAT_WS('', 'x') AS `x`
#> FROM `df`

lazy_frame(x = 1) %>% 
  mutate(x = sql(!!paste0("x")))
#> <SQL>
#> SELECT x AS `x`
#> FROM `df`

Created on 2022-07-29 by the reprex package (v2.0.1)

Fixing this would also help in #951.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions