Question
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.

Thanks!

 

30
4 0 11 264
Log in or sign up to continue

Replies

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"

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

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 ***)

Nigel

Thank you Evgeny