@terascope/data-types / types/base-type
types/base-type
Classes
| Class | Description |
|---|---|
| default | The 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
| Interface | Description |
|---|---|
| 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?
optionalincludePrivate?:boolean
Defined in: data-types/src/types/base-type.ts:17
isInput?
optionalisInput?:boolean
Defined in: data-types/src/types/base-type.ts:16
typeName?
optionaltypeName?:string
Defined in: data-types/src/types/base-type.ts:15
useSnakeCase?
optionaluseSnakeCase?: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
| Parameter | Type |
|---|---|
type | string |
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
| Parameter | Type |
|---|---|
name | string |
Returns
string