Skip to main content

@terascope/data-types / types/base-type

types/base-type

Classes​

ClassDescription
defaultThe abstract base class every field type extends. It captures a single field's identity (field name, its DataTypeFieldConfig, and the data-type version) and defines the contract for converting that field into each supported output format.

Interfaces​

InterfaceDescription
IBaseType-

Type Aliases​

ToGraphQLOptions​

ToGraphQLOptions = object

Defined in: data-types/src/types/base-type.ts:14

Options controlling how a field is rendered into GraphQL.

Properties​

includePrivate?​

optional includePrivate?: boolean

Defined in: data-types/src/types/base-type.ts:17

isInput?​

optional isInput?: boolean

Defined in: data-types/src/types/base-type.ts:16

typeName?​

optional typeName?: string

Defined in: data-types/src/types/base-type.ts:15

useSnakeCase?​

optional useSnakeCase?: boolean

Defined in: data-types/src/types/base-type.ts:18

Functions​

formatGQLType()​

formatGQLType(type, desc?): string

Defined in: data-types/src/types/base-type.ts:113

Prefix a GraphQL type/field line with its formatted description, when present.

Parameters​

ParameterType
typestring
desc?string

Returns​

string


quoteDuckDBIdentifier()​

quoteDuckDBIdentifier(name): string

Defined in: data-types/src/types/base-type.ts:128

Quote a DuckDB identifier, always. Used for STRUCT member names, which can be any DataType field name, including reserved words (inner, order) and tuple positions (0).

Quoting unconditionally is safe because DuckDB matches quoted identifiers case-insensitively.

@terascope/sql-builder has the same one-liner; it is duplicated so this package does not depend on a query builder just for one line.

Parameters​

ParameterType
namestring

Returns​

string