From 4f654204560040fe5ff97af02fcb8d9586a04b65 Mon Sep 17 00:00:00 2001 From: Frank DeFalco Date: Tue, 11 Oct 2022 17:22:14 -0400 Subject: [PATCH] use the sqlrender function for supported dialects --- DESCRIPTION | 2 +- R/listSupportedVersions.R | 3 ++- man/createDdl.Rd | 6 +++--- man/writeDdl.Rd | 11 ++++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e8b93e..5ec34b2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,5 +24,5 @@ Suggests: RSQLite, withr NeedsCompilation: no -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.1 Config/testthat/edition: 3 diff --git a/R/listSupportedVersions.R b/R/listSupportedVersions.R index 223248d..9482204 100644 --- a/R/listSupportedVersions.R +++ b/R/listSupportedVersions.R @@ -12,6 +12,7 @@ listSupportedVersions <- function() { #' @export listSupportedDialects <- function() { - supportedDialects <- c("oracle", "postgresql", "pdw", "redshift", "impala", "netezza", "bigquery", "sql server", "spark", "snowflake", "synapse") + sqlRenderSupportedDialects <- SqlRender::listSupportedDialects() + supportedDialects <- sqlRenderSupportedDialects$dialect return(supportedDialects) } diff --git a/man/createDdl.Rd b/man/createDdl.Rd index 8030fa3..dfd8612 100644 --- a/man/createDdl.Rd +++ b/man/createDdl.Rd @@ -30,11 +30,11 @@ Dashboard. } \section{Functions}{ \itemize{ -\item \code{createPrimaryKeys}: createPrimaryKeys Returns a string containing the OHDSQL for creation of primary keys in the OMOP CDM. +\item \code{createPrimaryKeys()}: createPrimaryKeys Returns a string containing the OHDSQL for creation of primary keys in the OMOP CDM. + +\item \code{createForeignKeys()}: createForeignKeys Returns a string containing the OHDSQL for creation of foreign keys in the OMOP CDM. -\item \code{createForeignKeys}: createForeignKeys Returns a string containing the OHDSQL for creation of foreign keys in the OMOP CDM. }} - \examples{ ddl <- createDdl("5.4") pk <- createPrimaryKeys("5.4") diff --git a/man/writeDdl.Rd b/man/writeDdl.Rd index 0014b39..26e9de0 100644 --- a/man/writeDdl.Rd +++ b/man/writeDdl.Rd @@ -36,7 +36,8 @@ writeIndex( ) } \arguments{ -\item{targetDialect}{The dialect of the target database. Choices are "oracle", "postgresql", "pdw", "redshift", "impala", "netezza", "bigquery", "sql server"} +\item{targetDialect}{The dialect of the target database. Choices are "oracle", "postgresql", "pdw", "redshift", "impala", "netezza", "bigquery", "sql server", +"spark", "snowflake", "synapse"} \item{cdmVersion}{The version of the CDM you are creating, e.g. 5.3, 5.4} @@ -52,10 +53,10 @@ execution. } \section{Functions}{ \itemize{ -\item \code{writePrimaryKeys}: writePrimaryKeys Write the SQL code that creates the primary keys to a file. +\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{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. -\item \code{writeIndex}: writeIndex Write the rendered and translated sql that creates recommended indexes to a file. }} -