I am using this amazing JavaScript SQL Query Builder UI REDQueryBuilder and I am able to generate the query. However I wish to validate the input textbox.
for e.g. If I have configured a column type as Integer, I wish to handle it in client side itself. The problem is it generates the textboxe's dynamically so it's difficult to validate it.
As you can see below I have CUSTOMER_ID as Integer,
So when we input the data in the textbox I want to read the meta config: tables > columns > type with the textbox input. similarly I can move further for other types like boolean, char etc...
meta looks something like this
{
"tables": [{
"name": "CUSTOMER_DETAILS",
"label": "Customer Details",
"columns": [{
"name": "CUSTOMER_ID",
"label": "Customer Id",
"type": "INTEGER",
"size": 20
}, {
"name": "ACCOUNT_NO",
"label": "Account No",
"type": "TEXT",
"size": 20
}, {
"name": "CITY_NAME",
"label": "City",
"type": "TEXT",
"size": 100
}, {
"name": "NAME",
"label": "NAME",
"type": "TEXT",
"size": 100
}],
"fks": []
}],
"types": [{
...
}]
}