Wappler Version : 7.5.2
Operating System : Windows 11
Server Model: NodeJS
Database Type: Postgres
Hosting Type: AWS
I need to be able to construct a sql statement from a bunch of different conditions. To accomplish this, I must be able to use a variable (let’s call it sqlStatement), concatenate SQL clauses in it, and then execute it by placing it in a custom sql query step as follows:
Given the type of application, sometimes the query ends up having 200-300 lines of SQL code and because of the way these queries are generated I just CANNOT put it in the body of the Database Custom Query step.
The approach I’m using works well from the perspective of the interaction with the database.
My problem is with the Set Value step.
Expected behavior
The expected behaviour is that if in this step I select a format like SQL, using the selector on the top right corner, and put SQL code in the body of the step
when I open the step it again, the text inside it would be formatted as the SQL code I typed, properly maintaining the indentations and the colour-coding of the keywords. For example, something like this:
Actual behavior
When you open the step for editing it, however, my SQL code looks like this:
This step always had a problem, but 7.5.2 had made it way worse for me.
Prior to 7.5.2, the step “forgot” that the text was SQL and when I re-opened the step, its text came indented but not colour-coded.
If by accident I saved the step, the text would be formatted “weirdly”, as shown above. Note that the selector shows “Text” instead of SQL.
This was rather annoying but there WAS a workaround: I needed to select SQL in the dropdown and then save the step again. The next time I opened it, the selector would show Text but the code would be readable and indented, albeit with no colour-coding. This was bad but it was not the end of the world for me, because I had a workaround and as soon as I selected SQL, the code would become colour-coded again.
With 7.5.2, this bad situation became really worse, because the workaround no longer works. This is not only annoying. With queries with more than 3 lines, the code is totally unreadable.
How to reproduce
- Put a Set Value step
- Open it (with the “pencil” icon)
- Select SQL
- Put your SQL code with your desired white space
- Save the content
- Reopen the step to see your code shown as one long line.
One additional thought:
Would it be better if Wappler used the same editors for the front and the back end code, instead of using one editor for the Set Value step that is different from the one used when creating a page (the one that behaves like Microsoft’s VS-Code) ?



