Skip to content

Commit

Permalink
Merge pull request #46 from OHDSI/eu44
Browse files Browse the repository at this point in the history
Add test to assert that table and column names are lowercase
  • Loading branch information
fdefalco authored Jun 6, 2023
2 parents 67dca78 + 1ebb641 commit ae18eb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ License: Apache License 2.0
URL: https://github.com/OHDSI/Eunomia
BugReports: https://github.com/OHDSI/Eunomia/issues
Depends:
DatabaseConnector (>= 2.2.0)
DatabaseConnector (>= 6.0.0)
Imports:
readr,
rlang,
Expand Down
11 changes: 11 additions & 0 deletions tests/testthat/test-basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ test_that("Connect", {
DatabaseConnector::disconnect(connection)
})

test_that("Table names and column names case", {
connection <- DatabaseConnector::connect(getEunomiaConnectionDetails())
tableNames <- DatabaseConnector::getTableNames(connection, cast = 'none')
expect_true(identical(tableNames, tolower(tableNames)))

for (tableName in tableNames) {
colNames <- DatabaseConnector::dbListFields(connection, tableName)
expect_true(identical(colNames, tolower(colNames)))
}
})

test_that("Query", {
connection <- DatabaseConnector::connect(getEunomiaConnectionDetails())
personCount <- DatabaseConnector::querySql(connection, "SELECT COUNT(*) FROM main.person;")
Expand Down

0 comments on commit ae18eb0

Please sign in to comment.