Convert a module YAML definition to OHDSI SQL CREATE TABLE statements
Source:R/migration_engine.R
yamlDefinitionToSql.RdReads a HADES module definition (file path or parsed list) and produces
OHDSI SQL CREATE TABLE statements parameterized with @database_schema.
Render the returned SQL with SqlRender::render(sql, database_schema = "mySchema")
before execution.
Usage
yamlDefinitionToSql(
definition,
databaseSchema = "@database_schema",
additionalTables = c("cg_cohort_definition", "database_meta_data")
)Arguments
- definition
Either a path to a
definition.yamlfile or a list as returned byyaml::read_yaml().- databaseSchema
Schema parameter to embed. Defaults to the literal
"@database_schema"for deferred rendering viaSqlRender::render().- additionalTables
Character vector of table names from other modules that may appear in foreign-key references. Defaults to the two standard cross-module tables.