nbenn opened a new issue, #1396:
URL: https://github.com/apache/arrow-adbc/issues/1396

   For the DBI integration of ADBC via adbcdrivermanager (adbi), I need the 
ability to quote both identifiers, as well as (arbitrary) literals. Currently I 
rely exclusively on the default quoting mechanism of DBI, which is problematic 
in cases where backends deviate from that standard.
   
   In order for me to switch to the quoting infrastructure of 
adbcdrivermanager, quoting of literals needs to become more capable. Some 
examples with what I can do with DBI:
   
   ```r
   DBI::dbQuoteLiteral(DBI::ANSI(), c(1:3, NA))
   #> <SQL> 1
   #> <SQL> 2
   #> <SQL> 3
   #> <SQL> NULL
   DBI::dbQuoteLiteral(DBI::ANSI(), c(TRUE, FALSE, NA))
   #> <SQL> 1
   #> <SQL> 0
   #> <SQL> NULL
   DBI::dbQuoteLiteral(DBI::ANSI(), list(as.raw(1:3), NULL))
   #> <SQL> X'010203'
   #> <SQL> NULL
   DBI::dbQuoteLiteral(DBI::ANSI(), Sys.time())
   #> <SQL> '20231222091012'
   #> DBI::dbQuoteLiteral(DBI::ANSI(), Sys.Date())
   #> <SQL> '2023-12-22'
   DBI::dbQuoteLiteral(DBI::ANSI(), as.difftime(1, units = "mins"))
   #> <SQL> '00:01:00'
   ```
   
   The default for string literals is mostly aligned with DBI apart from `NA` 
handling
   
   ```r
   DBI::dbQuoteLiteral(DBI::ANSI(), c("a", NA))
   #> <SQL> 'a'
   #> <SQL> NULL
   adbcdrivermanager::adbc_connection_quote_string(
     structure(list(), class = "con"),
     c("a", NA)
   )
   #> [1] "'a'"  "'NA'"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to