Created
July 28, 2025 13:10
-
-
Save alexandramartinez/88723e3d977e854b5390cc863ccd9328 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %dw 2.0 | |
| output application/java | |
| var completed = attributes.queryParams.completed | |
| var dueDate = attributes.queryParams.dueDate | |
| var whereClause = if (isEmpty(completed) and isEmpty(dueDate)) "" else "WHERE " ++ ( | |
| [ | |
| ("completed = $completed") if (!isEmpty(completed)), | |
| ("dueDate = $dueDate") if (!isEmpty(dueDate)) | |
| ] joinBy " AND " | |
| ) | |
| --- | |
| "SELECT * FROM tasks $whereClause" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment