Skip to main content

use

How to use enginesever

Protocol

Engine Server supports two protocols for request

  • HTTP : default port 8080
  • gRPC : default port 50051

Show Databases

Each data source has a database configuration in Engine Server, which is equivalent to a Database in Mysql.

Engine Server provides the ability to query all connected data sources.

# path:api/v1/databases
curl --location 'http://localhost:8080/api/v1/databases'
{
"databases": [
{
"name": "eng_test",
"description": ""
},
{
"name": "library",
"description": ""
}
]
}

Show Table Infos

Selecting a database can list all tables and table info under the data source.

Currently, this capability is only implemented for the bleve data source, and will be added to mysql and milvus later.

# path:api/v1/databases/{database name}/tables
curl --location 'http://localhost:8080/api/v1/databases/library/tables'
{
"tables": [
{
"name": "test",
"description": "",
"columns": [
{
"name": "id",
"type": "String",
"description": ""
},
{
"name": "name",
"type": "String",
"description": ""
},
{
"name": "gender",
"type": "String",
"description": ""
}
]
},
{
"name": "ebook",
"description": "",
"columns": [
{
"name": "_id",
"type": "String",
"description": ""
},
{
"name": "title",
"type": "String",
"description": ""
},
{
"name": "author",
"type": "String",
"description": ""
},
{
"name": "size",
"type": "Float",
"description": ""
}
]
}
]
}

Query

You can use SQL to query data from Engine Server.

NOTE: Engine Server supports most SQL syntax, SQL Statements

# path:api/v1/query
curl --location 'http://localhost:8080/api/v1/query' \
--header 'Content-Type: application/json' \
--data '{"sql": "select * from eng_test.books limit 5;"}'
{
"results": [
{
"columns": [
{
"name": "id",
"type": "Int",
"description": ""
},
{
"name": "title",
"type": "String",
"description": ""
},
{
"name": "author",
"type": "String",
"description": ""
},
{
"name": "create_time",
"type": "Int",
"description": ""
}
],
"rows": [
{
"columnValues": [
"1",
"The Great Adventure",
"John Smith",
"1672531199"
]
},
{
"columnValues": [
"2",
"Mystery of the Lost City",
"Jane Doe",
"1672617599"
]
},
{
"columnValues": [
"3",
"Exploring the Universe",
"Albert Johnson",
"1672703999"
]
},
{
"columnValues": [
"4",
"The Secrets of Time",
"Emily Davis",
"1672790399"
]
},
{
"columnValues": [
"5",
"History of the Ancient World",
"Michael Brown",
"1672876799"
]
}
]
}
],
"tookTimes": 0.003779769
}