make_create_table: Create an SQL CREATE TABLE query.

View source: R/factories.R

make_create_tableR Documentation

Create an SQL CREATE TABLE query.

Description

Create a QueryCreate instance.

Usage

make_create_table(tabl, fields_def)

Arguments

tabl

Name of the new table

fields_def

An list of ExprFieldDef instances.

Value

An instance of QueryCreate.

Examples

# To generate the CREATE query for creating a simple table for listing books:
fields_def <- list(ExprFieldDef$new('id', 'integer', primary=TRUE),
                   ExprFieldDef$new('title', 'varchar(200)', nullable=FALSE),
                   ExprFieldDef$new('author', 'varchar(80)', nullable=FALSE))
create <- make_create_table(tabl = 'books', fields_def = fields_def)


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.