View source: R/database-explorer.R
| db_explorer | R Documentation |
Composes a lazy object tree, SQLite table preview, SQL editor and result table, details and in-memory query history. The object tree loads metadata only when its Tables or Views node is expanded. DBI/RSQLite remain optional dependencies.
db_explorer(connection, id = NULL)
connection |
A |
id |
Optional widget identifier. |
A DatabaseExplorer widget with $refresh(), $run_query(),
$open_table(), and $query_history() methods.
if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) {
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
DBI::dbWriteTable(con, "mtcars", mtcars)
pilot <- test_app(app(db_explorer(db_connection(con, owned = TRUE))))
pilot$stop() # App teardown closes its owned connection.
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.