syrona_connect: Connect to a DuckDB OMOP CDM.

View source: R/connect.R

syrona_connectR Documentation

Connect to a DuckDB OMOP CDM.

Description

Opens a DuckDB file and creates a CDMConnector reference. By default the connection is read-only; set read_only = FALSE if you need to write cohort tables or temp tables into the database.

Usage

syrona_connect(
  db_path,
  cdm_schema = "main",
  write_schema = cdm_schema,
  read_only = TRUE
)

Arguments

db_path

Path to the DuckDB file.

cdm_schema

Schema containing OMOP CDM tables (default "main").

write_schema

Schema for writing temp/cohort tables. Defaults to cdm_schema. Set to a different schema if the CDM schema is read-only (common in production setups).

read_only

Logical. Open DuckDB in read-only mode? Default TRUE. Set to FALSE when you need to create cohort tables or use omopgenerics::insertTable.

Value

A list with components:

con

DBI connection object.

cdm

CDMConnector CDM reference (cdm_reference).


syrona documentation built on Sept. 5, 2026, 1:06 a.m.