For older version SQLFlow under Windows¶
This page is for SQLFlow 5.x.x.x¶
Please refer to the latest install manual if you are using the latest SQFlow (version > 6.0.0.0):
!!! note "Windows Installation" Click here to view the Windows Installation documentation
You can check this page for the SQLFlow berfore version
!!! note "Old version installation" Click here to view old version page documentation
Prerequisites¶
- SQLFlow on-premise version
- Server with at least 8GB memory
- install JDK1.8\ SET JAVA_HOME variable, and then add %JAVA_HOME%\bin to the path variable




- install Nginx for windows Download the Nginx Windows version here: http://nginx.org/en/docs/windows.html
Unzip SQLFlow file¶
- create a folder: c:\wings\sqlflow
- unzip SQLFlow install package to c:\wings\sqlflow, you will get 2 directories like:
- c:\wings\sqlflow\backend
- c:\wings\sqlflow\frontend
Start SQLFlow backend¶
- Open a dos command windows
- cd c:\wings\sqlflow\backend\bin
- run backend.bat
- please wait 3-5 minutes to allow the SQLFlow service to start completely.
Nginx Reverse Proxy¶
If we set the reverse proxy path of gspLive restful service to /api
1. config Nginx
- enter conf directory where Nginx is installed such as Nginx-1.19.4\conf
- modify the Nginx.conf, replace the server section in nginx.conf with the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Please make sure C:\wings\sqlflow\frontend
is where the SQLFlow frontend is installed, otherwise, please change C:\wings\sqlflow\frontend
to the path where the SQLFlow frontend is located.
2. modify frontend configuration file config.private.json
- Open the configration file "C:\wings\sqlflow\frontend\config.private.json"
- Modify the ApiPrefix attribute
1 |
|
start Nginx¶
- Open a dos command window
- cd the directory where Nginx is installed
- run just nginx.exe
SQLFlow is ready¶
Open the browser and go to localhost or got to the IP where the SQLFlow is installed.
- Open http://yourIp/ to see the SQLFlow.
- Open http://yourIp/api/gspLive_backend/doc.html?lang=en to see the Restful API documention.
Stop the SQLFlow¶
- close the window where the backend.bat is running.
- cd c:\wings\sqlflow\backend\bin
- run stop.bat
Sqlflow client api call¶
-
Get userId from gudu_sqlflow.conf
-
Open the configration file "c:\wings\sqlflow\backend\conf\gudu_sqlflow.conf"
- The value of anonymous_user_id field is webapi userId
1 |
|
-
Note: on-promise mode, webapi call doesn't need the token parameter
-
Test webapi by curl
- test sql:
1
select name from user
- curl command:
1
curl -X POST "http://yourIp/api/gspLive_backend/sqlflow/generation/sqlflow" -H "accept:application/json;charset=utf-8" -F "userId=YOUR USER ID HERE" -F "dbvendor=dbvoracle" -F "sqltext=select name from user"
- response:
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "code": 200, "data": { "dbvendor": "dbvoracle", "dbobjs": [ ... ], "relations": [ ... ] }, "sessionId": ... }
- If the code returns 401, please check the userId is set or the userId is valid.
troubleshooting¶
Hostname error¶
Make sure the window hostname doesn't include the underscore symbol (_), otherwise, the service will not work properly. please change it to minus symbol (-)
Cannot start ¶
If you have following errors when starting backend.bat
1 |
|
Please check the first section of this page, confirm that your JDK environement variable is successfully set. You may need to restart your server to enable the change.
Error uploading large file¶
This is due to nginx config. Nginx by default limit the size of the files uploaded. Add the following config in your http
block of the Nginx config file to change the file upload size in Nginx
1 |
|

This increases the limit to 200M, if needed you may change this number.