Dynamic SQL query

Hi,
I’m trying to build a complex, dynamic SQL query, in which the tables, attributes to return, and where clauses would be defined based on choices that the user makes in the front end. Among other things, the user will be able to narrow the search by creating nested AND and OR choices.

I thought of doing the following:
a) Assemble a SQL query string in the front end, based on the choices made by the user
b) Pass that SQL query string to the back end, using a server connect
c) In the Wappler API called by the server connect,

I tested the back end part (point c) and I can see that it works.

I have two questions:

  1. Is what I described an appropriate way to address this issue or am I exploiting a feature that will be removed in the future?

  2. Is there a better way to create this, knowing that there is no way at the start to know which table, attributes, and nested and/or conditions the user will impose as constraints?

Many thanks!

Community Page
Last updated: