OMOP/man/writeDdl.Rd

62 lines
1.7 KiB
Plaintext
Raw Normal View History

% Generated by roxygen2: do not edit by hand
Add unit tests for all databases and DDLs (#431) * Add github actions workflow to build package and run tests. * update Description file * rename .Rproj file. * Consolidate 'create' functions into one file. * Add tests for create functions. * update description * removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file. * consolidate write functions into one file. Add execute function. * update docs * add tests for write and execute functions * update documentation * Add windows and linux runners in github actions. * update github actions * download drivers before running tests * fix small error in setup test file. * debug github actions * debug github actions * debug github actions * debug github actions * fix tiny bug * comment out execute ddl test * fix bug in test * Add execute test back in * revert accidental change in description * add print statement for debugging schema error on github actions. * Fix schema environment variable name * Add comment to github actions workflow file. * remove placeholder text in function documentation. * Rename createdDdl.R to createDdl.R * Hack-a-thon updates Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264 * Changed bigint to integer for consistency * Updated DDLs * Add tests for redshift. Clean up test setup file. * Foreign key fixes * Add imports and update docs. * Fix bug in setup test script. * update setup file * Add tests for oracle and sql server. Move setup.R file. * fix bug in setup * debug tests on github * debug github actions * debug actions. * debug actions * debug actions. * Add missing secrets to yaml!! * debug actions * test connection on all platforms * add ddl execution * add windows and linux runners Co-authored-by: Adam Black <adam.black@odysseusinc.com> Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
2021-08-20 11:59:29 +00:00
% Please edit documentation in R/writeDdl.R
\name{writeDdl}
\alias{writeDdl}
\alias{writePrimaryKeys}
\alias{writeForeignKeys}
\alias{writeIndex}
\title{Write DDL script}
\usage{
writeDdl(
targetDialect,
cdmVersion,
outputpath,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writePrimaryKeys(
targetDialect,
cdmVersion,
outputpath,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writeForeignKeys(
targetDialect,
cdmVersion,
outputpath,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writeIndex(
targetDialect,
cdmVersion,
outputpath,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
}
\arguments{
\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}
\item{outputpath}{The directory or folder where the SQL file should be saved.}
\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"}
}
\description{
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.
}
\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.
}}