make_table: Copy a remote tbl into a Table.

Description Usage Arguments Examples

View source: R/make_table.R

Description

Using dbplyr::compute, this function can be used at the end of a dplyr chain to create a permanent table in Snowflake. Uses the database and schema defined in the connection.

Usage

1
make_table(.data, name, .conn = NA)

Arguments

.data

Incoming object from dplyr pipeline or a tbl object

name

The name of the desired table. Can use dplyr::in_schema() to specify a table in a different schema than the one that was defined in the connection. Note: will be dropped and recreated if a table already exists.

.conn

The connection object (needed to drop the table before 'compute' is called)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
conn <- connect_cdw()

demo <- ccdm_tbl(conn, "HOSPITAL_ENCOUNTERS") %>% head()

make_table(demo, name = "DELETEME", conn)

demo %>%
make_table(in_schema("PHC_DB_DEV.SANDBOX", "DELETEME"), conn)

disconnect_cdw(conn)


## End(Not run)

RollieParrish/ccdm documentation built on Dec. 31, 2020, 4:26 p.m.