Query functions | R Documentation |
These functions send a query to the given database, and are the access point for all tcpl functions that query or update the tcpl database.
tcplQuery(
query,
db = getOption("TCPL_DB"),
drvr = getOption("TCPL_DRVR"),
tbl = NULL
)
tcplQueryAPI(resource = "data", fld = NULL, val = NULL, return_flds = NULL)
tcplSendQuery(
query,
db = getOption("TCPL_DB"),
drvr = getOption("TCPL_DRVR"),
tbl = NULL,
delete = F
)
query |
Character of length 1, the query string |
db |
Character of length 1, the name of the tcpl database |
drvr |
Character of length 1, which database driver to use |
tbl |
Tables to be read queried |
resource |
must be either data or assay to determine which api endpoint to hit |
fld |
field that should be used to query the api |
val |
value for specified field to query on |
return_flds |
optional list of fields that should be returned |
delete |
Logical of length 1, execute delete on queried table |
Currently, the tcpl package supports the "MySQL", "example", and "API" database drivers.
tcplQuery
returns a data.table object with the query results.
tcplSendQuery
sends a query, but does not fetch any results, and
returns 'TRUE' or the error message given by the database.
tcplQueryAPI
returns a data.table object with the query results when
connected using "API" as driver.
## Not run:
# only with MySQL driver
tcplQuery("SELECT 'Hello World';")
# only with API driver
tcplConfDefault()
tcplQueryAPI(resource = "data", fld = "aeid", val = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.