Table of Contents

Interface IScalarFunctions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

A dialect's renderer for the cross-provider scalar string/number functions of CommonFunctions (left/right, lpad/rpad, repeat/reverse/space, concat_ws, translate, ascii/char, bit_length/octet_length, cot/degrees/radians/pi). The predicate and the renderer live on one object, so a name the dialect reports as supported always has a rendering; a provider that can express only part of the family answers Supports(string) per name, and a provider that can express none returns null from ScalarFunctions.

public interface IScalarFunctions
Extension Methods

Remarks

Unlike the stateless IIifRenderer/ILimitByRenderer, this object carries both the per-name predicate and the renderer, hence the plural capability-noun name rather than the *Renderer suffix.

Methods

GetUnsupportedReason(string)

The reason the scalar function name is unavailable on this dialect's declared state (for example a function that requires a later server version), or null when the name is supported, is unknown to the dialect, or the dialect has no version-specific answer. The caller shows this reason instead of its generic "not supported" message, so a version-gated name fails closed with the required and the declared version. Declared as a default interface method returning null so an external IScalarFunctions written before the member existed keeps its previous behaviour.

string? GetUnsupportedReason(string name)

Parameters

name string

The CLR method name of the CommonFunctions member.

Returns

string

Render(string, IReadOnlyList<string>)

Renders the scalar function name over the already-rendered args. name is the CLR method name of the CommonFunctions member (for example lpad, concat_ws).

string Render(string name, IReadOnlyList<string> args)

Parameters

name string
args IReadOnlyList<string>

Returns

string

Supports(string)

True when the scalar function name can be rendered.

bool Supports(string name)

Parameters

name string

Returns

bool