Open zacdav-db opened 4 months ago
A DBI/dbplyr interface to the sql execution api is very interesting to me! I'm currently using ODBC locally and then connecting via sparklyr
when working in a notebook (via an internal R package). Most of the time the same code works, but there are some quirks where I need to disbatch to methods based on connection type. It sounds like the SQL api would be a unifying method and easier for the co-workers to setup (Just need the PAT, I'd think?)
I was looking for your work on it, but couldn't find it the branches. Is it some you're still considering? Thanks!
Most of the time the same code works, but there are some quirks where I need to disbatch to methods based on connection type
@ndiquattro I'd love to know more about the methods that are causing some friction so I can create test cases.
Just need the PAT, I'd think? Ideally, not even PAT, OAuth would be first class citizen ideally.
There isn't a branch yet, the test I'd done was in a seperate project. I hope to get around to this shortly after a few more changes to package.
The largest one has been around DBI::dbWriteTable()
which had three issues:
useNativeQuery = FALSE
, in order for writing to work. I end up making a temporary connection within my helper function to do this while keeping it TRUE elsewhere.Id
and full name, whereas sparklyr just wanting a character value consiting of just schema.name
append = TRUE
, the ODBC connection will create the table if it doesn't exist, but sparklyr
will error.Trying to fix issue 3 led me to differences with DBI::dbListTables()
dbListTables()
, where sparklyr is templating a SHOW TABLES
query, that doesn't offer that ability. Thanks for your work on this package!
Currently
{brickster}
has two ways to query a SQL warehouse:databricks-sql-connector
via{reticulate}
A
{DBI}
and{dbplyr}
backend could be created for each, this would enable querying SQL warehouses without ODBC driver installation.I've done a small proof of concept and this works extremely well, few bits to iron out. Unsure if worth splitting to another package 🤔.