NAME
Text::Query::BuildSQL - Base class for SQL query builders
SYNOPSIS
package Text::Query::BuildSQLsqldb;
use Text::Query::BuildSQL;
use vars qw(@ISA);
@ISA = qw(Text::Query::BuildSQL);
DESCRIPTION
Defines all the build_* functions to build a syntactic tree. The tree nodes are [ operator scope operand operand... ]. The build_final_expression function translate the syntactic tree in a where clause using the resolve method. If the scope of the search is not specified (simple query or advanced query without scope operator), the scope is set to the list of comma separated fields provided by the -fields_searched option. The resulting where clause is placed in the select order provided with the -select option, if any.
METHODS
- resolve([], Q1)
-
Returns a
whereclause string corresponding to theQ1syntactic tree. - sortplusminus([], Q1)
-
Translate the
mandatoryandforbidensyntactic nodes to their boolean equivalents.
OPTIONS
- -select STRING
-
If provided the string returned by
build_final_expressionsubstitutes the__WHERE__tag with thewherestring generated by theresolvefunction. The substituted string is the return value of thebuild_final_expression.If not set the return value of the
build_final_expressionis the result of theresolvefunction. - -fields_searched FIELDS_LIST
-
FIELDS_LISTis a list of comma separated field names. It is used as the default scope if no scope is provided in the query string. Thebuild_final_expressionfunction willcroakif this option is not provided and no scope operator were used.
SEE ALSO
Text::Query(3) Text::Query::Build(3)
AUTHORS
Loic Dachary (loic@senga.org)