Constructor
new StructType(fieldsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fields |
Array.<module:eclairjs/sql/types.StructField> |
<optional> |
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 | module:eclairjs/sql/types.StructField | ||
dataType |
module:eclairjs/sql/types.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
fieldNames() → {Array.<string>}
Returns all field names in an array.
- Source:
Returns:
- Type
- Array.<string>
fields() → {Array.<module:eclairjs/sql/types.StructField>}
- Source:
Returns:
- Type
- Array.<module:eclairjs/sql/types.StructField>
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