Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
Merge branch 'develop' into feature/TTAmeds
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
peterdutey committed May 11, 2024
2 parents 58a3f03 + dae3e73 commit 8cdcee7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
16 changes: 8 additions & 8 deletions R/database.R
Original file line number Diff line number Diff line change
Expand Up @@ -1224,31 +1224,31 @@ create_mock_database <- function(file,
conn,
statement = paste0(
"CREATE UNIQUE INDEX ", override_index_name,
" ON ", table, " (", field, ");"
" ON \"", table, "\" (", field, ");"
)
)
} else if ( is(conn, "duckdb_connection") & is.null(override_index_name) ) {
DBI::dbExecute(
conn,
statement = paste0(
"CREATE UNIQUE INDEX ", table, "_pk",
" ON ", table, " (", field, ");"
" ON \"", table, "\" (", field, ");"
))
} else if( is(conn, "PqConnection") & !is.null(override_index_name) ) {
DBI::dbExecute(
conn,
statement = paste0(
"alter table ", table,
" add constraint ", override_index_name,
"alter table \"", table,
"\" add constraint ", override_index_name,
" primary key (", field,");"
)
)
} else if( is(conn, "PqConnection") & is.null(override_index_name) ) {
DBI::dbExecute(
conn,
statement = paste0(
"alter table ", table,
" add constraint ", table, "_pk ",
"alter table \"", table,
"\" add constraint ", table, "_pk ",
"primary key (\"", field,"\");"
))
} else {
Expand All @@ -1269,14 +1269,14 @@ create_mock_database <- function(file,
DBI::dbExecute(
conn,
paste0("create index ", override_index_name,
" on ", table, " (", fields, ");")
" on \"", table, "\" (", fields, ");")
)
} else {
for (i in fields) {
DBI::dbExecute(
conn,
paste0("create index idx_", table, "_", i,
" on ", table, " (\"", i, "\");")
" on \"", table, "\" (\"", i, "\");")
)
}
}
Expand Down
5 changes: 0 additions & 5 deletions tests/testthat/test-warehousing-postgres.R
Original file line number Diff line number Diff line change
Expand Up @@ -1063,11 +1063,6 @@ test_that("Encounter class on Postgres", {
DBI::dbListTables(pq_conn))
DBI::dbDisconnect(pq_conn)
})
on.exit({
.remove_db_tables(conn = pq_conn,
DBI::dbListTables(pq_conn))
DBI::dbDisconnect(pq_conn)
})

# database loading functions ------------------------------------------

Expand Down

0 comments on commit 8cdcee7

Please sign in to comment.