NAME

Class::ReluctantORM::SQL::Expression - Base class for SQL expressions

DESCRIPTION

Abstract base class for SQL expressions. Often used as arguments to Functions, as sources for OutputColumns, and in other places.

Useful known subclasses:

Class::ReluctantORM::SQL::Column
Class::ReluctantORM::SQL::Param
Class::ReluctantORM::SQL::Expression::Criterion
Class::ReluctantORM::SQL::Expression::Literal
Class::ReluctantORM::SQL::Expression::FunctionCall
Class::ReluctantORM::SQL::SubQuery

VIRTUAL METHODS

All of these methods are intended to be overridden in subclasses. Some methods provide a default implementation.

$bool = $arg->is_leaf_expression();

Indicates if the object is a terminal point on the Expression tree. Default implementation returns true.

@args = $arg->child_expressions();

Returns any children of the expression. Results only defined if is_leaf is false.

$arg = $arg->parent_expression();

Returns the parent node of the expression. If undefined, this is the root node.

$str = $arg->pretty_print();

Returns a human-readable string representation of the expression.

$rel->walk_leaf_expressions($coderef);

Recurses throughout the expression tree, and executes the coderef on each leaf of the expression.

The coderef will be passed the leaf expression as the only parameter.