The purpose of this repo is to demonstrate the use of Denodo's ability to perform a POST request to an API using SQL, which is a relatively undocumented feature.
Denodo standard and well documented features include turning JSON data from an API into flattened views, as well as doing INSERT commands to JDBC databases.
- Denodo Express
- Python installed (covered in step 1)
Follow the below steps to explore this feature:
-
First, create a flask webapp using these intructions. The
app.py
file in this repo is based on those intructions, but it is worth following that tutorial first to understand the mechanics of flask.- Start the app using
python app.py
- Start the app using
-
Now notice the
app2.py
file in this repo which has been modified to return JSON format from the POST request, see JSONIFY details. The JSONIFY is necessary to ensure that the API returns whatever is posted to it in JSON format, which Denodo is able to turn into a virtual view.- Stop the other
app.py
and start the new one usingpython app2.py
- Stop the other
-
Now to virtualize in Denodo. The .VQL file contained in this repo contain all the details, and the VQL folder can be virtualized into Denodo.
- Install Denodo Express and launch the server and VDP Admin Tool
- Import the
flask_post_api.vql
into Denodo using the Denodo IMPORT functionality. - Notice that a data source, base view and flattened view is imported
- Open the VQL Shell
-
We can now run queries against our flatted view in Denodo, such as the following, which will execute a POST against the API, and return the results, which can be joined to other applicable views:
select * from f_post_api_test where lang = 'TEST'