View source: R/uploadToDatabase.R
createPlpResultTables | R Documentation |
This function executes a large set of SQL statements to create tables that can store models and results
createPlpResultTables(
connectionDetails,
targetDialect = "postgresql",
resultSchema,
deleteTables = TRUE,
createTables = TRUE,
tablePrefix = "",
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
testFile = NULL
)
connectionDetails |
The database connection details |
targetDialect |
The database management system being used |
resultSchema |
The name of the database schema that the result tables will be created. |
deleteTables |
If true any existing tables matching the PatientLevelPrediction result tables names will be deleted |
createTables |
If true the PatientLevelPrediction result tables will be created |
tablePrefix |
A string that appends to the PatientLevelPrediction result tables |
tempEmulationSchema |
The temp schema used when the database management system is oracle |
testFile |
(used for testing) The location of an sql file with the table creation code |
This function can be used to create (or delete) PatientLevelPrediction result tables
Returns NULL but creates or deletes the required tables in the specified database schema(s).
# create a sqlite database with the PatientLevelPrediction result tables
connectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "sqlite",
server = file.path(tempdir(), "test.sqlite"))
createPlpResultTables(connectionDetails = connectionDetails,
targetDialect = "sqlite",
resultSchema = "main",
tablePrefix = "plp_")
# delete the tables
createPlpResultTables(connectionDetails = connectionDetails,
targetDialect = "sqlite",
resultSchema = "main",
deleteTables = TRUE,
createTables = FALSE,
tablePrefix = "plp_")
# clean up the database file
unlink(file.path(tempdir(), "test.sqlite"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.