Skip to content

ConstantFoldingOptimizer

ConstantFoldingOptimizer inlines constant scalar and aggregate literal values within function calls and select statements with their evaluated result.

new ConstantFoldingOptimizer(options?): ConstantFoldingOptimizer

constructor configures constant folding from a plain option object.

ConstantFoldingOptimizerOptions = {}

ConstantFoldingOptimizer

optimize(context, ast): AST

optimize queries the expression graph for scalar and aggregate literal expressions within call and select statements, evaluates them, and replaces each call site with its result.

Only values which can be represented as literals in CEL syntax are supported.

OptimizerContext

AST

AST

ASTOptimizer.optimize