sql-rest-api

Downloads54
Subscribe
3
Bookmark
2
This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.
Details
Releases
Reviews
Issues
Articles

What's new in this version

Icon change

sql2json-rest-api

The app installs a /sql REST API web app which accepts SQL query with POST request on /sql/query endpoint and returns the result in JSON.

Installation with ZPM

zpm:USER>install sql-rest

Installation for development

Create your repository from template.

Clone/git pull the repo into any local directory e.g. like it is shown below (here I show all the examples related to this repository, but I assume you have your own derived from the template):

$ git clone git@github.com:evsharov/sql-rest-api.git

Open the terminal in this directory and run:

$ docker-compose up -d --build

or open the folder in VSCode and do the following: rest

How to Work With it

This template creates /sql REST web-application on IRIS which accepts POST requests with SQL and returns results in JSON

Open http://localhost:52775/swagger-ui/index.html?url=http://localhost:52775/api/mgmnt/v1/USER/spec/sql to test the REST API

You can query any table in IRIS in the namespace.

e.g. you can test with Titanic data, which you have if you start docker. if you installed with ZPM in a clear namespace you can import titanic data as:

USER>zpm "install csvgen" USER>d ##class(community.csvgen).GenerateFromURL("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",",","Data.Titanic")

And run query POST request as: Screenshot 2020-12-12 at 23 52 40

and have the result as: Screenshot 2020-12-12 at 23 54 36

IPM installation
zpm "install sql-rest"
Rating
5 (1)
ObjectScript quality test
Passed
Updated on 04 December 2023
ObjectScript quality report
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
Tags
Info
Version
1.0.2
Last updated
2021-11-07
Repository
Open
Documentation
Open
License
Link