ExprFieldDef: Table field definition.

ExprFieldDefR Documentation

Table field definition.

Description

Table field definition.

Table field definition.

Details

Used to define a field when creating a table.

Super classes

sqlq::Statement -> sqlq::Expr -> ExprFieldDef

Methods

Public methods

Inherited methods

Method new()

Initializer.

Usage
ExprFieldDef$new(name, type, primary = FALSE, nullable = TRUE)
Arguments
name

The field name.

type

The field's type (integer, date, varchar(...), ...).

primary

Set to TRUE if the field is a PRIMARY KEY.

nullable

Set to FALSE of the field does not accept NULL values.

Returns

Nothing.


Method getTokens()

Generates the list of tokens representing this statement.

Usage
ExprFieldDef$getTokens()
Returns

A list of Token objects.


Method clone()

The objects of this class are cloneable with this method.

Usage
ExprFieldDef$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# To generate the definition of a field named "title":
ExprFieldDef$new("title", "TEXT", nullable = FALSE)


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