View source: R/datatable-source-query.R
| db_query_source | R Documentation |
The source implements table_source() and fetches bounded pages for a
query result. The built-in pager supports RSQLite only. Other DBI drivers
can provide an adapter list with column_names(connection, query, params), row_count(connection, query, params), and get_rows(connection, query, params, start, count, columns) callbacks. This keeps dialect-specific
pagination in the backend adapter rather than assuming all DBI drivers use
the same SQL.
db_query_source(connection, query, params = NULL, adapter = NULL)
connection |
A |
query |
A single query that returns a result set. |
params |
Optional DBI parameter list passed to the query. |
adapter |
Optional backend adapter callbacks. |
The built-in SQLite adapter wraps the query as a subquery, runs one cached
COUNT(*), and adds bound LIMIT/OFFSET values to page requests. A single
trailing semicolon is removed before wrapping. The query must produce one
result set; arbitrary SQL statements are not parsed or rewritten. The row
count can be expensive, but it is computed once at source creation and on
explicit refresh, never on repaint.
The returned source is read-only. Sorting, filtering, and search are not pushed into the user query.
An experimental table_source() accepted directly by
data_table().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.