dump_sql | R Documentation |
Writes the generated sql to a file or command line. The script contains ALTER and UPDATE statements and can be used for documentation purposes.
dump_sql(x, table, con = NULL, file = stdout(), ...)
x |
|
table |
either a |
con |
optional, when |
file |
to which the sql will be written. |
... |
not used |
Note that when this script is run on the database it will change the original table. This differs from the default behavior of dcmodify which works on a (temporary) copy of the table.
Furthermore, it seems wise to wrap the generated SQL in a transaction when apply the SQL code on a database.
character
sql script with all statements.
Other sql translation:
modifier_to_sql()
# load modification rules and apply: library(dcmodify) con <- DBI::dbConnect(RSQLite::SQLite(), dbname=system.file("db/person.db", package="dcmodifydb")) person <- dplyr::tbl(con, "person") rules <- modifier(.file = system.file("db/corrections.yml", package="dcmodifydb")) print(rules) # show sql code generated from the rules. dump_sql(rules, person)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.