Skip to main content

@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​

ParameterType
valueunknown
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​

ParameterType
valueunknown

Returns​

xLuceneFieldType


isNumericFieldType()​

isNumericFieldType(fieldType?): boolean

Defined in: field-types.ts:25

Parameters​

ParameterType
fieldType?xLuceneFieldType

Returns​

boolean


isTextFieldType()​

isTextFieldType(fieldType?): boolean

Defined in: field-types.ts:29

Parameters​

ParameterType
fieldType?xLuceneFieldType

Returns​

boolean