Add execute test back in
This commit is contained in:
parent
cea09cf273
commit
c2717409d3
|
@ -56,29 +56,29 @@ test_that("Database can be connected to", {
|
||||||
disconnect(con)
|
disconnect(con)
|
||||||
})
|
})
|
||||||
|
|
||||||
# test_that("Execute DDL on Postgres", {
|
test_that("Execute DDL on Postgres", {
|
||||||
# # make sure the schema is cleared out
|
# make sure the schema is cleared out
|
||||||
# cdmDatabaseSchema <- Sys.getenv("CDMDDLBASE_POSTGRESQL_SCHEMA")
|
cdmDatabaseSchema <- Sys.getenv("CDMDDLBASE_POSTGRESQL_SCHEMA")
|
||||||
# cdmVersion <- "5.4"
|
cdmVersion <- "5.4"
|
||||||
# .removeConstraintsPostgresql(connectionDetails, cdmDatabaseSchema)
|
# .removeConstraintsPostgresql(connectionDetails, cdmDatabaseSchema)
|
||||||
# .dropAllTablesFromSchema(connectionDetails, cdmDatabaseSchema)
|
.dropAllTablesFromSchema(connectionDetails, cdmDatabaseSchema)
|
||||||
#
|
|
||||||
# executeDdl(connectionDetails,
|
executeDdl(connectionDetails,
|
||||||
# cdmVersion = cdmVersion,
|
cdmVersion = cdmVersion,
|
||||||
# cdmDatabaseSchema = cdmDatabaseSchema,
|
cdmDatabaseSchema = cdmDatabaseSchema,
|
||||||
# executeDdl = TRUE,
|
executeDdl = TRUE,
|
||||||
# executePrimaryKey = FALSE,
|
executePrimaryKey = FALSE,
|
||||||
# executeForeignKey = FALSE)
|
executeForeignKey = FALSE)
|
||||||
#
|
|
||||||
# tables <- .listTablesInSchema(connectionDetails, schema = cdmDatabaseSchema)
|
tables <- .listTablesInSchema(connectionDetails, schema = cdmDatabaseSchema)
|
||||||
#
|
|
||||||
# cdmTableCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Table_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
|
cdmTableCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Table_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
|
||||||
# tableSpecs <- read.csv(cdmTableCsvLoc, stringsAsFactors = FALSE)$cdmTableName
|
tableSpecs <- read.csv(cdmTableCsvLoc, stringsAsFactors = FALSE)$cdmTableName
|
||||||
#
|
|
||||||
# # check that the tables in the database match the tables in the specification
|
# check that the tables in the database match the tables in the specification
|
||||||
# expect_equal(sort(tables), sort(tableSpecs))
|
expect_equal(sort(tables), sort(tableSpecs))
|
||||||
#
|
|
||||||
# # clear schema
|
# clear schema
|
||||||
# .removeConstraintsPostgresql(connectionDetails, cdmDatabaseSchema)
|
# .removeConstraintsPostgresql(connectionDetails, cdmDatabaseSchema)
|
||||||
# .dropAllTablesFromSchema(connectionDetails, cdmDatabaseSchema)
|
.dropAllTablesFromSchema(connectionDetails, cdmDatabaseSchema)
|
||||||
# })
|
})
|
||||||
|
|
Loading…
Reference in New Issue