Skip to main content

Class: LanguageManager

Defined in: packages/core/src/lang-manager.ts:81

Manages the registration and retrieval of language-specific features.

Constructors

Constructor

new LanguageManager(db): LanguageManager

Defined in: packages/core/src/lang-manager.ts:90

Parameters

ParameterType
dbDortDBAsFriend

Returns

LanguageManager

Methods

getAggr()

getAggr(lang, name, schema?): AggregateFn

Defined in: packages/core/src/lang-manager.ts:190

Retrieves an aggregate function by name and schema for a specific language. If no such aggregate function is registered specifically for the language, also checks for global aggregate functions.

Parameters

ParameterTypeDescription
langstringThe language to search in.
namestringThe name of the aggregate function to retrieve.
schema?string | symbolThe schema of the aggregate function to retrieve.

Returns

AggregateFn

The requested aggregate function, or throws an error if not found.


getCast()

getCast(lang, name, schema?): Castable

Defined in: packages/core/src/lang-manager.ts:205

Retrieves a castable by name and schema for a specific language. If no such castable is registered specifically for the language, also checks for global castables.

Parameters

ParameterTypeDescription
langstringThe language to search in.
namestringThe name of the castable to retrieve.
schema?string | symbolThe schema of the castable to retrieve.

Returns

Castable

The requested castable, or throws an error if not found.


getFn()

getFn(lang, name, schema?): Fn

Defined in: packages/core/src/lang-manager.ts:179

Retrieves a function by name and schema for a specific language. If no such function is registered specifically for the language, also checks for global functions.

Parameters

ParameterTypeDescription
langstringThe language to search in.
namestringThe name of the function to retrieve.
schema?string | symbolThe schema of the function to retrieve.

Returns

Fn

The requested function, or throws an error if not found.


getFnOrAggr()

getFnOrAggr(lang, name, schema?): AggregateFn | Fn

Defined in: packages/core/src/lang-manager.ts:220

Retrieves a function or aggregate function by name and schema for a specific language. First checks for functions, then for global functions, then for aggregate functions, then for global aggregate functions.

Parameters

ParameterTypeDescription
langstringThe language to search in.
namestringThe name of the function or aggregate function to retrieve.
schema?string | symbolThe schema of the function or aggregate function to retrieve.

Returns

AggregateFn | Fn

The requested function or aggregate function, or throws an error if not found.


getLang()

getLang<Name, Lang>(name): Lang

Defined in: packages/core/src/lang-manager.ts:134

Retrieves a registered language by name.

Type Parameters

Type Parameter
Name extends string
Lang extends Language<Name>

Parameters

ParameterTypeDescription
nameNameThe name of the language to retrieve.

Returns

Lang


getOp()

getOp(lang, name, schema?): Operator

Defined in: packages/core/src/lang-manager.ts:168

Retrieves an operator by name and schema for a specific language. If no such operator is registered specifically for the language, also checks for global operators.

Parameters

ParameterTypeDescription
langstringThe language to search in.
namestringThe name of the operator to retrieve.
schema?string | symbolThe schema of the operator to retrieve.

Returns

Operator

The requested operator, or throws an error if not found.


getVisitorMap()

getVisitorMap<T>(visitor): Record<string, InstanceType<PlanVisitors[T]>>

Defined in: packages/core/src/lang-manager.ts:145

Creates a map of visitor instances for a specific visitor type.

Type Parameters

Type Parameter
T extends keyof PlanVisitors

Parameters

ParameterTypeDescription
visitorTThe visitor type to retrieve.

Returns

Record<string, InstanceType<PlanVisitors[T]>>

A map of language names to visitor instances.


registerExtension()

registerExtension(ext): void

Defined in: packages/core/src/lang-manager.ts:96

Registers a new language extension.

Parameters

ParameterTypeDescription
extExtensionThe extension to register.

Returns

void


registerLang()

registerLang(lang): void

Defined in: packages/core/src/lang-manager.ts:125

Registers a new language.

Parameters

ParameterTypeDescription
langLanguageThe language to register.

Returns

void