Class: StructType

eclairjs/sql/types.StructType

For a StructType object, one or multiple StructFields can be extracted by names. If multiple StructFields are extracted, a StructType object will be returned. If a provided name does not have a matching field, it will be ignored.

Constructor

new StructType(fields)

Parameters:
Name Type Description
fields Array.<module:eclairjs/sql/types.StructField> The name of this field.
Source:

Methods

add(name, dataType, nullableopt, metadataopt) → {module:eclairjs/sql/types.StructType}

Creates a new StructType by adding a new nullable field with no metadata.
Parameters:
Name Type Attributes Description
name string | StructField
dataType DataType | string
nullable boolean <optional>
defaults true, nullable field
metadata module:eclairjs/sql/types.Metadata <optional>
defaults to null, specifying metadata
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

apply(field) → {module:eclairjs/sql/types.StructField}

Extracts a StructField of the given name or index.
Parameters:
Name Type Description
field integer | string index or name
Source:
Returns:
Type
module:eclairjs/sql/types.StructField

defaultSize() → {integer}

The default size of a value of the StructType is the total default sizes of all field types.
Source:
Returns:
Type
integer

fieldIndex(name) → {integer}

Returns index of a given field
Parameters:
Name Type Description
name string
Source:
Returns:
Type
integer

length() → {integer}

Source:
Returns:
Type
integer

printTreeString() → {void}

Source:
Returns:
Type
void

simpleString() → {string}

Source:
Returns:
Readable string representation for the type.
Type
string

treeString() → {string}

Source:
Returns:
Type
string