r/adbcdrivermanager: Quoting of literals
- Dominant language
- C#
- Stars
- 627
- Forks
- 217
- Avg merge
- 17h
- Merged PRs (30d)
- 57
Description
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 might need to become more capable. Some examples with what I can do with DBI:
```r
DBI::dbQuoteLiteral(DBI::ANSI(), c(1:3, NA))
#> 1
#> 2
#> 3
#> NULL
DBI::dbQuoteLiteral(DBI::ANSI(), c(TRUE, FALSE, NA))
#> 1
#> 0
#> NULL
DBI::dbQuoteLiteral(DBI::ANSI(), list(as.raw(1:3), NULL))
#> X'010203'
#> NULL
DBI::dbQuoteLiteral(DBI::ANSI(), Sys.time())
#> '20231222091012'
DBI::dbQuoteLiteral(DBI::ANSI(), Sys.Date())
#> '2023-12-22'
DBI::dbQuoteLiteral(DBI::ANSI(), as.difftime(1, units = "mins"))
#> '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))
#> 'a'
#> NULL
adbcdrivermanager::adbc_connection_quote_string(
structure(list(), class = "con"),
c("a", NA)
)
#> [1] "'a'" "'NA'"
```
Contributor guide
Assessment
This issue has not been assessed yet.