sql-rest-api


Follow
0
Star
0
Details
Releases
Issues
This application is not supported by InterSystems Corporation. Use it at your own risk.

What's new in this version

changed the name

sql2json-rest-api

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

Prerequisites

Make sure you have git and Docker desktop installed.

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

ZPM installation
zpm "install sql-rest"
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
Tags
Info
Version
1.0.1
Last updated
2020-12-13
Repository
Open
Documentation
Open
License
Link