Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case sensitivity when translating to SQL #181

Closed
krlmlr opened this issue Nov 5, 2018 · 1 comment · Fixed by #220

Comments

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Nov 5, 2018

Some SQL functions may be case-sensitive, for instance spatial methods in MSSQL. The syntax is a bit weird, e.g. colname.STBuffer(1) for STBuffer(), the call COLNAME.STBUFFER(1) fails.

library(tidyverse)
library(dbplyr)
memdb_frame(a = 1) %>%
  mutate(x = a.STBuffer(1)) %>%
  sql_render()
#> <SQL> SELECT `a`, A.STBUFFER(1.0) AS `x`
#> FROM `opozhizxky`

Created on 2018-11-05 by the reprex package (v0.2.1.9000)

(This example works identically with MSSQL, using SQLite for the reprex.)

What's the reason for converting all function calls to uppercase?

@hadley

This comment has been minimized.

Copy link
Member

@hadley hadley commented Jan 2, 2019

Probably no good reason, except my sense of SQL aesthetics (which is clearly wrong here).

I suspect this would be an easy fix for someone; should just require searching for toupper() and removing the inappropriate ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.