beanumber / etl

R package to facilitate ETL operations
127 stars 21 forks source link

src_sqlite is deprecated #60

Closed beanumber closed 10 months ago

beanumber commented 3 years ago

Need to replace with DBI.

beanumber commented 11 months ago

This is going to be a bigger problem than I thought, because the DBIConnection objects are S4 objects, and the old src_sqlite objects were S3. etl objects were extensions of the latter, and so the old architecture was built on S3.

It's not clear to me how to proceed. Making etl objects S4 would break all of the existing code. I don't know how to mask an S4 object as an S3 object inside the etl object.

This is going to drop off of CRAN if we can't fix it.

Best bet might be to fake it by porting this code:

> dbplyr:::src_dbi
function (con, auto_disconnect = FALSE) 
{
    force(con)
    if (is_false(auto_disconnect)) {
        disco <- NULL
    }
    else {
        disco <- db_disconnector(con, quiet = is_true(auto_disconnect))
    }
    subclass <- paste0("src_", class(con)[[1]])
    structure(list(con = con, disco = disco), class = c(subclass, 
        "src_dbi", "src_sql", "src"))
}
<bytecode: 0x55f8f5096488>
<environment: namespace:dbplyr>