executeDdl: Generate and execute the DDL on a database

View source: R/executeDdl.R

executeDdlR Documentation

Generate and execute the DDL on a database

Description

This function will generate the DDL for a specific dbms and CDM version and then execute the DDL on a database.

Usage

executeDdl(
  connectionDetails,
  cdmVersion,
  cdmDatabaseSchema,
  executeDdl = TRUE,
  executePrimaryKey = TRUE,
  executeForeignKey = TRUE,
  ...
)

Arguments

connectionDetails

An object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails function.

cdmVersion

The version of the CDM you are creating, e.g. 5.3, 5.4

cdmDatabaseSchema

The schema of the CDM instance where the DDL will be run. For example, this would be "ohdsi.dbo" when testing on sql server.

executeDdl

Should the DDL be executed? TRUE or FALSE

executePrimaryKey

Should the primary keys be added? TRUE or FALSE

executeForeignKey

Should the foreign keys be added? TRUE or FALSE

...

Other arguments passed on to DatabaseConnector::executeSql. (This allows the user to set the path to errorReportFile.)

Value

Writes the fully specified DDLs, primary keys, foreign keys, and indices to a file and then executes on a database.

Examples

## Not run: 
executeDdl(connectionDetails = connectionDetails,
           cdmVersion = "5.4",
           cdmDatabaseSchema = "myCdm")

## End(Not run)

CommonDataModel documentation built on Oct. 2, 2024, 1:08 a.m.