write_rcdf_sqlite: Write RCDF data to a SQLite database

View source: R/write_rcdf_as.R

write_rcdf_sqliteR Documentation

Write RCDF data to a SQLite database

Description

Writes all tables in the RCDF object to a single SQLite database file.

Usage

write_rcdf_sqlite(data, path, db_name = "cbms_data", ..., parent_dir = NULL)

Arguments

data

A valid RCDF object.

path

Output directory for the database file.

db_name

Name of the SQLite database file (without extension).

...

Additional arguments passed to 'DBI::dbWriteTable()'.

parent_dir

Optional subdirectory under 'path' to store the SQLite file.

Value

Invisibly returns 'NULL'. A '.db' file is written to disk.

See Also

write_rcdf_as

Examples

dir <- system.file("extdata", package = "rcdf")
rcdf_path <- file.path(dir, 'mtcars.rcdf')
private_key <- file.path(dir, 'sample-private-key.pem')

rcdf_data <- read_rcdf(path = rcdf_path, decryption_key = private_key)
temp_dir <- tempdir()

write_rcdf_sqlite(data = rcdf_data, path = temp_dir)

unlink(temp_dir, force = TRUE)

rcdf documentation built on Aug. 28, 2025, 9:09 a.m.