REST API which accepts SQL and returns JSON
Hi folks!
Do we have an embedded REST API in IRIS which accepts arbitrary SQL and returns data in JSON?
Or if anyone did something like this?
The idea is to have something like MDX2JSON but SQL2JSON.
Thanks!
s sc=##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL("json","SELECT Name FROM Sample.Person")
+1 didn't know this existed, incredibly helpful!
Very nice! thanks for sharing
Thanks, Anton!
I packed your answer in sql-res-api module.
if you zpm it, you have /sql rest which accepts SQL with POST request and returns JSON.
USER>zpm "install sql-rest-api"
Query request in Atelier API
Obvious security ramifications disclaimer.
Also RESTForms UI provides a locked down implementation.
Hi
I was going to offer to write such a function but it appears that other developers have already got solutions for your request. Pity, its a nice challenge
Nigel
Hi Nigel! Thanks! Actually, I already crafted the module following @Anton Umnikov's advice above.
Lol, I was so busy reading all the other posts otherwise I would have sat down and written it.
Would you like to share your code with me
(*** please ***)
Nigel
Here it is!
Thank you Evgeny