Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Mar 15, 2024
1 parent f0894e5 commit 3be8802
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/create_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,12 @@ create_scdb_index.SQLiteConnection <- function(conn, db_table_id) {

#' @noRd
create_scdb_index.DBIConnection <- function(conn, db_table_id) {
schema <- purrr::pluck(db_table_id, "name", "schema")
table <- purrr::pluck(db_table_id, "name", "table")

index <- paste(c(shQuote(schema), shQuote(paste0(table, '_scdb_index'))), collapse = '.')

DBI::dbExecute(
conn,
glue::glue(
"CREATE UNIQUE INDEX {index} ON {as.character(db_table_id, explicit = TRUE)} (checksum, from_ts)"
"CREATE UNIQUE INDEX {stringr::str_replace(paste0(db_table_id, '_scdb_index'), stringr::fixed('.'), '_')} ",
"ON {as.character(db_table_id, explicit = TRUE)} (checksum, from_ts)"
)
)
}

0 comments on commit 3be8802

Please sign in to comment.