interface CubeEngine {
    completeCode(
        model: ModelContext,
        relation: undefined | IR,
        text: string,
    ): Promise<undefined | readonly CubeCodeCompletion[]>;
    execute(
        model: ModelContext,
        lambda: IR,
        options?: { abortController?: AbortController },
    ): Promise<CubeResult>;
    exportCsv(
        model: ModelContext,
        lambda: IR,
        options?: { abortController?: AbortController },
    ): Promise<string>;
    getFunctionCatalogue(): Promise<undefined | CubeFunctionCatalogue>;
    loadModel(model: ModelContext): Promise<CubeModelOutline>;
    parseExpression(
        code: string,
        sourceId: string,
    ): Promise<CubeParsedExpression>;
    planLambda(model: ModelContext, lambda: IR): Promise<void>;
    readExpressionOutline(
        json: JsonObject,
        code: string,
    ): undefined | CubeExpressionOutline;
    renderPure(lambda: IR): Promise<string>;
    resolveSchemas(
        model: ModelContext,
        accessors: ReadonlyMap<string, AccessorPath>,
    ): Promise<Map<string, CubeEngineError | Schema>>;
    serializeLambda(lambda: IR): string;
    typeLambdas(
        model: ModelContext,
        lambdas: ReadonlyMap<string, IR>,
    ): Promise<Map<string, CubeEngineError | Schema>>;
}

Methods

  • The engine's completions of Pure code written after a relation, e.g. ->filter(x | $x. after a node's input (user, 2026-10-16), or of code on its own, on the model as it is: undefined when the engine completes no code, as an engine without the service answers, and from then on; rejects with a CubeEngineError

    Parameters

    Returns Promise<undefined | readonly CubeCodeCompletion[]>

  • Runs an execution lambda and gives its rows as CSV text (PLAN §11.10): the engine's own, a header row first, every value as the engine writes it; rejects with a CubeEngineError

    Parameters

    • model: ModelContext
    • lambda: IR
    • Optionaloptions: { abortController?: AbortController }

    Returns Promise<string>

  • The engine's catalogue of Pure functions, its PCT documentation, for the expression editors' completions and help: read once, undefined when the engine doesn't serve it, and from then on

    Returns Promise<undefined | CubeFunctionCatalogue>

  • The outline of an expression of one row, x | …, from the engine's JSON of it (EXPRESSION-EDITOR.md, round 2): its parts placed in the code when the JSON was parsed with its source information; none for anything but a lambda of one expression

    Parameters

    • json: JsonObject
    • code: string

    Returns undefined | CubeExpressionOutline