sql_create_table: Generate SQL CREATE TABLE statements

Description Usage Arguments Value Examples

Description

Creates SQL CREATE TABLE statements from a vector of column names and a vector of column types

Usage

1
2
sql_create_table(tname, col_names, col_types, sql_opts = rep("",
  length(col_names)))

Arguments

tname

character scalar. Name of target sql table

col_names

character vector. Column names of target sql table

col_types

character scalar. Column types of target sql table. Columns of type NA will be skipped

sql_opts

column options of target sql table (for example NOT NULL)

Value

a CREATE TABLE statement as a character scalar

Examples

1
2
3
4
5
6
sql_create_table(
  "example.table",
  c("numbers", "animals"),
  c("integer", "varchar(8)"),
  c("NOT NULL", "")
)

s-fleck/tabde documentation built on May 4, 2019, 1:23 p.m.