Resolve "Improve SQL fields to allow operations (improve also where clauses)"
What does this MR do
Improve the SQL queries definition with a more powerful field definition
Impacts
value
attribute is no more allowed on field
elements:
- Replace
<field value="XXX"
with<static value="XXX"
-
DataListUtil.addColumn
method now has 3 parameters instead of 4 (removed type parameter)
New field definition
SQL FIELDS
<static value="Lalal" type="STRING"/>
<field id="field2" table="table2"/>
ADD
<operation operator="ADD" alias="added">
<field id="field1">
<field id="field2" table="table2"/>
</operation>
CONCAT
<operation operator="CONCAT" alias="parent">
<field id="parent">
<static value="Pro" />
<field id="Nam" table="pro"/>
<static value="-Mod" />
<field id="Nam" table="mod"/>
</operation>
DATE ADD
<operation operator="ADD_DAYS" alias="dateAdded">
<field id="dateField">
<static value="2" type="INTEGER"/>
</operation>
CASE
<case alias="value">
<when condition="eq">
<left-operand id="Nam"/>
<right-operand variable="sunset"/>
<then variable="1"/>
</when>
<when left-field="Nam" condition="eq" right-variable="sunny"><then variable="2"/></when>
<when left-field="Nam" condition="eq" right-variable="purple-hills"><then variable="3"/></when>
<else variable="0"/>
</case>
FILTER CLAUSES
<filter condition="eq">
<left-operand field="lalala" table="tutut"/>
<right-operand operator="ADD">
<field id="lala">
<static value="2" type="INTEGER"/>
</right-operand>
</filter>
Related issues
Fix #71 (closed) Fix #70 (closed)
Your checklist for this pull request
-
Make sure your merge request is to develop or /feature /bugfix branch. Don't request your master! -
Check the commit's or even all commits' message styles matches our requested structure. -
Check the commit's pass the CI pipeline. -
New and existing unit tests pass locally with my changes. -
Commented code, particularly in hard-to-understand areas
Description
Please describe your pull request.
Closes #71 (closed)
Edited by Pablo Javier García Mora