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:
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:
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