You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "nbenn (via GitHub)" <gi...@apache.org> on 2023/12/22 09:19:13 UTC
[I] r/adbcdrivermanager: Quoting of literals [arrow-adbc]
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] r/adbcdrivermanager: Quoting of literals [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #1396:
URL: https://github.com/apache/arrow-adbc/issues/1396#issuecomment-1867771021
Filed #1398 to track moving this down into the driver itself at some point
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org