db.open | R Documentation |
Open a new database connection
db.open(
file = ":memory:",
functions = list(),
modules = list(),
views = list(),
register = TRUE,
mode = c("r+", "r")
)
file |
A character string specifying the database file. If it is the special string ':memory:', a new temporary database is created in computer memory. If it is an empty string, a new on-disk database is created in the system's temporary location. Otherwise it should specify a file path. If the path exists, the database is opened. If it does not exist a new on-disk database is created at that location and opened. |
functions |
A named list of functions. Each element is a user-defined SQL function to register with the database connection. |
modules |
A named list of virtual table module factories created
by |
views |
A named list of functions. Each element is a function
that implements a database documentation page. See |
register |
A boolean. Should the database connection be registered
with the internal registry? |
mode |
If |
When a database connection is opened the database is checked for the presence of a system table named dbpkg. This table can be used to register virtual table implementations, user-defined SQL functions, and documentation pages with the database connection. The dbpkg table should have the following schema
CREATE TABLE dbpkg ( pkg TEXT NOT NULL PRIMARY KEY )
where 'pkg' is the name of an R package that implements the various
extensions. An R package that implements dbpkg extensions must contain
three objects in its namespace named 'functions', 'modules', and 'views',
each of which is expected to be a named list of functions to register with
the newly formed database connection. Note that any functions passed in
as arguments to db.open
(via 'functions', 'modules', and 'views')
take precedence over functions provided by dbpkg extensions.
An S4 object of class "database". This object has three slots.
the handle
slot is an external pointer to the underlying
sqlite3 database object. The file
slot is a character string
with the absolute path of the database file. The name
slot is
the name of the database file.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.