Evgeny Shvarov · Dec 8, 2020

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.


0 379
Discussion (11)4
Log in or sign up to continue
s sc=##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL("json","SELECT Name FROM Sample.Person")

+1 didn't know this existed, incredibly helpful!

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"


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


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 devil (*** please ***)