query_sqlite: Sqlite implementation of a query_fun.

Description Usage Arguments Details Examples

View source: R/sqlite.R

Description

Simple implementation showing how to implement a query_fun for a sqlite DB.

Usage

1
query_sqlite(con, params, tbl, id_field = NA)

Arguments

con

DBI database connection

params

named list provided by a datatable containing sorting, filtering and pagination data.

tbl

string, the table/view in sqlite.

id_field

string, optional. Field used to identify a row when using input$tbl_rows_selected.

Details

This function can be provided to sql_filter_factory to describe how to fetch a datatable payload from a sqlite table.

This implementation provides paging and sorting, but filtering and row indices filters are not yet implemented.

This function will be called via sql_filter_factory with arguments

con, page, and ... (where ... are any extra arguments given to sql_filter_factory). With this example an additional tbl parameter has been implemented, which would be expected to be passed in when sql_filter_factory is called.

Examples

1
2
3
4
## Not run: 
sql_filter_factory(con, query_sqlite, tbl = "mtcars")

## End(Not run)

grahamrp/dtdatasources documentation built on Dec. 8, 2019, 12:38 p.m.