Write gaiaDB DDL script
writeDdl.Rd
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.
Usage
writeOccurrencePrimaryKeys(
targetDialect,
gaiaVersion,
outputfolder,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writeOccurrenceForeignKeys(
targetDialect,
gaiaVersion,
outputfolder,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writeOccurrenceIndex(
targetDialect,
gaiaVersion,
outputfolder,
cdmDatabaseSchema = "@cdmDatabaseSchema"
)
writeDdl(gaiaVersion, outputfolder)
writePrimaryKeys(gaiaVersion, outputfolder)
writeForeignKeys(gaiaVersion, outputfolder)
Arguments
- gaiaVersion
The version of the CDM you are creating, e.g. 5.3, 5.4
- outputfolder
The directory or folder where the SQL file should be saved.
Functions
writeOccurrencePrimaryKeys()
: writePrimaryKeys Write the SQL code that creates the primary keys to a file.writeOccurrenceForeignKeys()
: writeForeignKeys Write the SQL code that creates the foreign keys to a file.writeOccurrenceIndex()
: writeIndex Write the rendered and translated sql that creates recommended indexes to a file.writePrimaryKeys()
: writePrimaryKeys Write the SQL code that creates the primary keys to a file.writeForeignKeys()
: writeForeignKeys Write the SQL code that creates the foreign keys to a file.