Skip to contents

Deletes a row or rows by specifying the unique ids for the rows to delete Note: not implemented in a UI button, but here for administrator use

Usage

cdr_delete_row_in_db(
  conn_pool = conn_pool,
  db_tbl_name = NULL,
  value_rowuid = NULL,
  key_column = NULL
)

Arguments

conn_pool

pool connection object: the pool of connections established by the session

db_tbl_name

string: name of the specific database table, or cdr_id() object

value_rowuid

number or string: the specific the unique ID that corresponds to the row to delete

key_column

string: the name of the column with the unique ID

Value

TRUE for successful deletion

Examples

if (FALSE) {
con <- pool::dbPool(DBI::dbConnect(RSQLite::SQLite(), 'iris.db'))
iris <- dplyr::mutate(iris, unique_id = paste0('uid_',dplyr::row_number()))
cdr_make_db_tbls(conn_pool = con, db_tbl = iris)
print(here::here('iris.db'))
cdr_delete_row_in_db(
  conn_pool = con,
  db_tbl_name = 'iris', #'iris_deltas'
  value_rowuid = 'uid_1',
  key_column = 'unique_id'
  )
pool::poolClose(con)
}