logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SQL::Statement::TermFactory - Factory for SQL::Statement::Term instances

Description

       This package implements a factory to create type and operation based terms.  Those terms are used to
       access data from the table(s) - either when evaluating the where clause or returning column data.

       The concept of a factory can be studied in DesignPatterns by the Gang of Four. The concept of using
       polymorphism instead of conditions is suggested by Martin Fowler in his book Refactoring.

Methods

buildCondition
       Builds a condition object from a given (part of a) where clause. This method calls itself recursively for
       predicates.

Name

       SQL::Statement::TermFactory - Factory for SQL::Statement::Term instances

Synopsis

         my $termFactory = SQL::Statement::TermFactory->new($stmt);
         my $whereTerms = $termFactory->buildCondition( $stmt->{where_clause} );
         my $col = $termFactory->buildCondition( $stmt->{col_obj}->{$name}->{content} );

See Also