2021-06-09 00:19:01 +00:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
2021-08-19 03:36:11 +00:00
|
|
|
% Please edit documentation in R/writeDdl.R
|
|
|
|
\name{writeDdl}
|
|
|
|
\alias{writeDdl}
|
|
|
|
\alias{writePrimaryKeys}
|
|
|
|
\alias{writeForeignKeys}
|
|
|
|
\alias{writeIndex}
|
2021-06-09 00:19:01 +00:00
|
|
|
\title{Write DDL script}
|
|
|
|
\usage{
|
2021-08-19 03:36:11 +00:00
|
|
|
writeDdl(
|
|
|
|
targetDialect,
|
|
|
|
cdmVersion,
|
|
|
|
outputpath,
|
|
|
|
cdmDatabaseSchema = "@cdmDatabaseSchema"
|
|
|
|
)
|
|
|
|
|
|
|
|
writePrimaryKeys(
|
|
|
|
targetDialect,
|
|
|
|
cdmVersion,
|
|
|
|
outputpath,
|
|
|
|
cdmDatabaseSchema = "@cdmDatabaseSchema"
|
|
|
|
)
|
|
|
|
|
|
|
|
writeForeignKeys(
|
|
|
|
targetDialect,
|
|
|
|
cdmVersion,
|
|
|
|
outputpath,
|
|
|
|
cdmDatabaseSchema = "@cdmDatabaseSchema"
|
|
|
|
)
|
|
|
|
|
|
|
|
writeIndex(
|
|
|
|
targetDialect,
|
|
|
|
cdmVersion,
|
|
|
|
outputpath,
|
|
|
|
cdmDatabaseSchema = "@cdmDatabaseSchema"
|
|
|
|
)
|
2021-06-09 00:19:01 +00:00
|
|
|
}
|
|
|
|
\arguments{
|
2021-08-19 03:36:11 +00:00
|
|
|
\item{targetDialect}{The dialect of the target database. Choices are "oracle", "postgresql", "pdw", "redshift", "impala", "netezza", "bigquery", "sql server"}
|
|
|
|
|
|
|
|
\item{cdmVersion}{The version of the CDM you are creating, e.g. 5.3, 5.4}
|
2021-06-09 00:19:01 +00:00
|
|
|
|
2021-08-19 03:36:11 +00:00
|
|
|
\item{outputpath}{The directory or folder where the SQL file should be saved.}
|
2021-06-09 00:19:01 +00:00
|
|
|
|
2021-08-18 19:30:04 +00:00
|
|
|
\item{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.
|
|
|
|
Defaults to "@cdmDatabaseSchema"}
|
2021-06-09 00:19:01 +00:00
|
|
|
}
|
|
|
|
\description{
|
2021-08-19 03:36:11 +00:00
|
|
|
Write the DDL to a SQL file. The SQL will be rendered (parameters replaced) and translated to the target SQL
|
|
|
|
dialect. By default the @cdmDatabaseSchema parameter is kept in the SQL file and needs to be replaced before
|
|
|
|
execution.
|
2021-06-09 00:19:01 +00:00
|
|
|
}
|
2021-08-19 03:36:11 +00:00
|
|
|
\section{Functions}{
|
|
|
|
\itemize{
|
|
|
|
\item \code{writePrimaryKeys}: writePrimaryKeys Write the SQL code that creates the primary keys to a file.
|
|
|
|
|
|
|
|
\item \code{writeForeignKeys}: writeForeignKeys Write the SQL code that creates the foreign keys to a file.
|
|
|
|
|
|
|
|
\item \code{writeIndex}: writeIndex Write the rendered and translated sql that creates recommended indexes to a file.
|
|
|
|
}}
|
|
|
|
|