The server is accessed through the standard GET, POST methods, the parameters of which specify SQL, written in JSON format. The query result is returned as an array of JSON format.
works as an HTTP server and allows you to receive files from a directory \htdocs
allows you to get results from fixed teams without authorization
by the name of the command a file must be formed in the directory \sql
example:
Command \users = http://127.0.0.1:8080/users => will use the file \sql\users.sql ,
the request may contain JSON parameters for SQL.; {"Date1": "01.01.2020", "Date2": "01.02.2020"}
Parameters in Body: JSON format
Request example:
{
"DB": {
"DatabaseName": "127.0.0.1:E:\\base\\Base.FDB",
"UserName": "user",
"Password": "pas" ,
"CharSet" : "WIN1251",
"SQLDialect": 1,
"RoleName": "",
"DBParams" : ""
},
"SQL": "Select id, name from USERS"
}
or sample default database query:
{
"SQL": "Select id, name from USERS"
}
SELECT response example:
{
"result": true,
"error": "",
"table": {
"fields":[
{
"name": "id",
"type": "Integer",
"type_code":500,
"size": 2
},
{
"name": "name",
"type": "String",
"type_code":448,
"size": 30
}
],
"rows": [
{
"id": 1,
"name":"user1"
},
{
"id": 2,
"name":"user2"
}
]
}
}
Example response for INSERT/UPDATE/DELETE:
{
"result": true,
"error": "",
}
Response example:
{
"result": false,
"error": "Erorr SQL parsing"
}
Response example:
{
"result": false,
"error": "No authorization"
}
Server interface
Test page
Response example