Description Usage Arguments Details Value Examples
View source: R/sql_filter_factory.R
Given a DBI connection and a query function return a funcFilter function as required by DT::renderDT.
1 | sql_filter_factory(con, query_fun, ...)
|
con |
DBI database connection for |
query_fun |
function that takes |
... |
Additional arguments passed to |
The main purpose of this function is to keep a reference to the database connection so as to prevent the need to set up a new connection every time data is accessed by the funcFilter.
It also allows for different implementations of query_fun
so as not
to be limited to just the current sqlite implementation.
function conforming to a DT funcFilter interface.
1 2 3 4 5 6 | ## Not run:
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbWriteTable(con, "mtcars", mtcars)
myFuncFilter <- sql_filter_factory(con, query_sqlite, tbl = "mtcars")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.