Skip to contents

Add tables to a cdm object

Usage

insertTable(cdm, name, table)

insert_table(cdm, name, table)

Arguments

cdm

A cdm reference

name

A character name with the name of the table.

table

Table to insert in the cdm object. It has to be a in R-memory table.

Value

Returns the cdm object with the new tables added

Examples

if (FALSE) {
library(CDMConnector)

con <- DBI::dbConnect(duckdb::duckdb(), dbdir = eunomia_dir())
cdm <- cdm_from_con(con, cdm_schema = "main", write_schema = "main")

cdm

new_table <- dplyr::tibble(a = 1)

cdm <- insertTable(cdm, "new_table", new_table)

cdm

cdm$new_table

cdm_disconnect(cdm)
}