View source: R/get_sql_create.R
get_sql_create | R Documentation |
This function uses the output from nchar_df()
to generate a SQL CREATE TABLE
statement
that can be used to create the skeleton table in Postgres. The result can be copied and pasted for use.
get_sql_create(pg_fields, schema = "public", pkey = NULL, tbl_name = NULL, export = FALSE, path = NULL, ...)
pg_fields |
a named |
schema |
an optional argument to specify the desired schema for |
pkey |
a |
tbl_name |
a require option if |
export |
a |
path |
a |
... |
other arguments passed to |
NOTE: write_pg()
does not use the SQL statement to write to PostgreSQL, but solely uses the result
from set_pgfields()
results in a SQL statement to CREATE TABLE
. See DBI::SQL
## Not run: nchar_df <- get_nchar(iris) my_pgfields <- set_pgfields(nchar_df, conn = local_con_test) get_sql_create(my_pg_fields, pkey = "Species", tbl_name = "iris") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.