@aradox/multi-orm
Version:
Type-safe ORM with multi-datasource support, row-level security, and Prisma-like API for PostgreSQL, SQL Server, and HTTP APIs
47 lines • 1.45 kB
TypeScript
/**
* Computed Field Executor
*
* Loads and executes computed field resolvers defined in the schema.
* Supports both synchronous and asynchronous resolvers with timeout control.
*/
import type { Field } from '../types/ir';
export interface ComputedExecutorOptions {
/** Base path for resolving resolver file paths */
basePath: string;
/** Timeout in milliseconds for async computed fields (default: 5000ms) */
timeout?: number;
/** Whether to throw on timeout or return undefined (default: false - return undefined) */
throwOnTimeout?: boolean;
/** Cache loaded resolver functions */
cacheResolvers?: boolean;
}
export declare class ComputedExecutor {
private resolverCache;
private options;
constructor(options: ComputedExecutorOptions);
/**
* Execute computed fields on a set of rows
*/
executeComputedFields(rows: any[], model: string, fields: Record<string, Field>, select?: Record<string, boolean>): Promise<any[]>;
/**
* Execute computed fields for a single row
*/
private executeForRow;
/**
* Execute a single computed field
*/
private executeField;
/**
* Load a resolver function from file path
*/
private loadResolver;
/**
* Execute resolver with timeout
*/
private executeWithTimeout;
/**
* Clear resolver cache
*/
clearCache(): void;
}
//# sourceMappingURL=computed-executor.d.ts.map