Create the results tables to store characterization results into a database
Source:R/Database.R
createCharacterizationTables.RdThis function executes a large set of SQL statements to create tables that can store results
Usage
createCharacterizationTables(
connectionDetails,
resultSchema,
targetDialect = "postgresql",
deleteExistingTables = TRUE,
createTables = TRUE,
tablePrefix = "c_",
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema")
)Arguments
- connectionDetails
The connectionDetails to a database created by using the function
createConnectDetailsin theDatabaseConnectorpackage.- resultSchema
The name of the database schema that the result tables will be created.
- targetDialect
The database management system being used
- deleteExistingTables
If true any existing tables matching the Characterization result tables names will be deleted
- createTables
If true the Characterization result tables will be created
- tablePrefix
A string appended to the Characterization result tables
- tempEmulationSchema
The temp schema used when the database management system is oracle
See also
Other Database:
createSqliteDatabase(),
insertResultsToDatabase()
Examples
# create sqlite database
charResultDbCD <- createSqliteDatabase()
# create database results tables
createCharacterizationTables(
connectionDetails = charResultDbCD,
resultSchema = 'main'
)
#> Connecting using SQLite driver
#> Deleting existing tables
#> Creating characterization results tables
#> Executing SQL took 0.0175 secs
#> Migrating data set
#> Migrator using SQL files in Characterization
#> Connecting using SQLite driver
#> Creating migrations table
#>
|
| | 0%
|
|======================================================================| 100%
#> Executing SQL took 0.0038 secs
#> Migrations table created
#> Executing migration: Migration_1-v3_0_0_store_version.sql
#>
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
#> Executing SQL took 0.00345 secs
#> Saving migration: Migration_1-v3_0_0_store_version.sql
#>
|
| | 0%
|
|======================================================================| 100%
#> Executing SQL took 0.00288 secs
#> Migration complete Migration_1-v3_0_0_store_version.sql
#> Executing migration: Migration_2-v4_0_0_table_change.sql
#>
|
| | 0%
|
|== | 4%
|
|===== | 7%
|
|======== | 11%
|
|========== | 14%
|
|============ | 18%
|
|=============== | 21%
|
|================== | 25%
|
|==================== | 29%
|
|====================== | 32%
|
|========================= | 36%
|
|============================ | 39%
|
|============================== | 43%
|
|================================ | 46%
|
|=================================== | 50%
|
|====================================== | 54%
|
|======================================== | 57%
|
|========================================== | 61%
|
|============================================= | 64%
|
|================================================ | 68%
|
|================================================== | 71%
|
|==================================================== | 75%
|
|======================================================= | 79%
|
|========================================================== | 82%
|
|============================================================ | 86%
|
|============================================================== | 89%
|
|================================================================= | 93%
|
|==================================================================== | 96%
|
|======================================================================| 100%
#> Executing SQL took 0.0251 secs
#> Saving migration: Migration_2-v4_0_0_table_change.sql
#>
|
| | 0%
|
|======================================================================| 100%
#> Executing SQL took 0.00292 secs
#> Migration complete Migration_2-v4_0_0_table_change.sql
#> Executing migration: Migration_3-v4_1_0_cohort_incidence.sql
#>
|
| | 0%
|
|========= | 12%
|
|================== | 25%
|
|========================== | 38%
|
|=================================== | 50%
|
|============================================ | 62%
|
|==================================================== | 75%
|
|============================================================= | 88%
|
|======================================================================| 100%
#> Executing SQL took 0.0074 secs
#> Saving migration: Migration_3-v4_1_0_cohort_incidence.sql
#>
|
| | 0%
|
|======================================================================| 100%
#> Executing SQL took 0.00287 secs
#> Migration complete Migration_3-v4_1_0_cohort_incidence.sql
#> Executing migration: Migration_4-v4_1_1_cohort_incidence.sql
#>
|
| | 0%
|
|====== | 8%
|
|============ | 17%
|
|================== | 25%
|
|======================= | 33%
|
|============================= | 42%
|
|=================================== | 50%
|
|========================================= | 58%
|
|=============================================== | 67%
|
|==================================================== | 75%
|
|========================================================== | 83%
|
|================================================================ | 92%
|
|======================================================================| 100%
#> Executing SQL took 0.0123 secs
#> Saving migration: Migration_4-v4_1_1_cohort_incidence.sql
#>
|
| | 0%
|
|======================================================================| 100%
#> Executing SQL took 0.00273 secs
#> Migration complete Migration_4-v4_1_1_cohort_incidence.sql
#> Closing database connection
#> Updating version number to 4.1.1
#> Executing SQL took 0.00338 secs