Methods
-
getRulesFromSQL( query, stmt ) → {object}
-
Description
Convert a SQL query to rules
Parameters
Name Type Description querystring | module:plugins.SqlSupport.SqlQuery stmtboolean | string Returns
Fires
Throws
Details
-
getSQL( [ stmt [, nl [, data ] ] ] ) → {module:plugins.SqlSupport.SqlQuery}
-
Description
Returns rules as a SQL query
Parameters
Name Type Attributes Default Description stmtboolean | string <optional> use prepared statements: false, 'question_mark', 'numbered', 'numbered(@)', 'named', 'named(@)'
nlboolean <optional> false output with new lines
dataobject <optional> current rules by default
Returns
Fires
Throws
Details
-
setRulesFromSQL()
-
Description
Sets the builder's rules from a SQL query
Details
Type Definitions
-
SqlQuery
-
Properties
Name Type Description sqlstring paramsobject Details
Events
-
changer:getSQLField
-
Description
Modifies the SQL field used by a rule
Parameters
Name Type Description fieldstring ruleRule Returns
Details
-
changer:getSQLFieldID
-
Description
Returns a filter identifier from the SQL field
Parameters
Name Type Description fieldstring value* Returns
Details
-
changer:groupToSQL
-
Description
Modifies the SQL generated for a group
Parameters
Name Type Description expressionstring groupGroup Returns
Details
-
changer:parseSQLNode
-
Description
Custom parsing of an AST node generated by SQLParser, you can return a sub-part of the tree, or a well formed group or rule JSON
Parameters
Name Type Description ASTobject node
Returns
Details
-
changer:ruleToSQL
-
Description
Modifies the SQL generated for a rule
Parameters
Name Type Description expressionstring ruleRule value* valueWrapperfunction function that takes the value and adds the operator
Returns
Details
-
changer:sqlGroupsDistinct
-
Description
Given an existing group and an AST node, determines if a sub-group must be created
Parameters
Name Type Description createboolean true by default if the group condition is different
groupobject ASTobject currentint group level
Returns
Details
-
changer:sqlToGroup
-
Description
Modifies the group generated from the SQL expression (this is called before the group is filled with rules)
Parameters
Name Type Description groupobject ASTobject Returns
Details
-
changer:sqlToRule
-
Description
Modifies the rule generated from the SQL expression
Parameters
Name Type Description ruleobject ASTobject Returns
Details