@terascope/sql-builder / field-types
field-types
Functions
canRenderValueAs()
canRenderValueAs(
value,fieldType?):boolean
Defined in: field-types.ts:53
Whether a value can be a value of this field type.
Used when a query names no field or a field pattern. A query that names its field was
already checked by the parser, but ba*:hello can expand to an integer column, where
"num" = 'hello' is a cast error that fails the whole query. Fields that return false
are left out of the expansion; in Elasticsearch they could not match either.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
fieldType? | xLuceneFieldType |
Returns
boolean
inferFieldType()
inferFieldType(
value):xLuceneFieldType
Defined in: field-types.ts:39
Infer a field type from a value's JavaScript type, for nodes that have no field_type.
The parser expands some:$array into terms that carry only a value, so the value's type
is all there is to go on.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
xLuceneFieldType
isNumericFieldType()
isNumericFieldType(
fieldType?):boolean
Defined in: field-types.ts:25
Parameters
| Parameter | Type |
|---|---|
fieldType? | xLuceneFieldType |
Returns
boolean
isTextFieldType()
isTextFieldType(
fieldType?):boolean
Defined in: field-types.ts:29
Parameters
| Parameter | Type |
|---|---|
fieldType? | xLuceneFieldType |
Returns
boolean