dplyr src_dbi not available

63 views
Skip to first unread message

Christian Hotz-Behofsits

unread,
Mar 12, 2017, 9:20:47 AM3/12/17
to manipulatr
I started to write a dplyr sql-backend for the clickhouse database based on Hannes Mühleisen's DBI-implementation (https://github.com/hannesmuehleisen/clickhouse-r). The connection itself should work, but I receive this strange error, when I use the new src_dbi method in "src_clickhouse":

#' @import methods
#' @importFrom dplyr src_dbi
#' @importFrom DBI dbConnect
#' @export
src_clickhouse
<- function(dbname = "default", host = "localhost", port = 8123L, user = "default",
                           password
= "", ...) {
 
if (!requireNamespace("dplyr", quietly = TRUE)) {
    stop
("dplyr is required to use src_clickhouse", call. = FALSE)
 
}

  con
<- dbConnect(clckhs::Clickhouse(), host = host, dbname = dbname,
                        user
= user, password = password, port = port, ...)
  src_dbi
(con)
}


(I am using the lastest master-version 0.5.0.9000), but it seems, like src_dbi is not available:

> test_con <- src_clickhouse(host="172.17.0.5", port = 8123L) Error in src_clickhouse(host = "172.17.0.5", port = 8123L) :
could
not find function "src_dbi"


Hadley Wickham

unread,
Mar 22, 2017, 4:37:19 PM3/22/17
to Christian Hotz-Behofsits, manipulatr
Are you sure you've re-documented() so that src_dbi() is actually
imported? (And given that you're only using it in one place, I
recommend not importing and using dplyr::src_dbi() instead)

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "manipulatr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to manipulatr+...@googlegroups.com.
> To post to this group, send email to manip...@googlegroups.com.
> Visit this group at https://groups.google.com/group/manipulatr.
> For more options, visit https://groups.google.com/d/optout.



--
http://hadley.nz

Christian Hotz-Behofsits

unread,
Apr 3, 2017, 1:31:45 AM4/3/17
to Hadley Wickham, manipulatr
Thanks, this might be the problem. I'll try it out!
Reply all
Reply to author
Forward
0 new messages