Skip to content

Commit 8c1bb79

Browse files
doc: update
1 parent bde4169 commit 8c1bb79

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

docs/embedding_integration.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,68 @@
189189
|field.comment |String |品类名称 |require|
190190
|field.type |String |TEXT |db 字段类型 requre|
191191

192+
响应示例:
193+
```json
194+
{
195+
"code": 200,
196+
"data": [
197+
{
198+
"name": "数据源 1",
199+
"type": "MySQL",
200+
"host": "192.168.1.1",
201+
"port": 3306,
202+
"user": "user",
203+
"password": "password",
204+
"dataBase": "sqlbot_demo",
205+
"schema": "schema",
206+
"comment": "数据源1备注信息",
207+
"tables": [
208+
// 无权限规则的数据表
209+
{
210+
"name": "数据表 1",
211+
"comment": "数据表 1 备注信息",
212+
"fields": [
213+
{
214+
"name": "age",
215+
"type": "bigint",
216+
"comment": "字段 1备注信息"
217+
},
218+
{
219+
"name": "gender",
220+
"type": "text",
221+
"comment": "字段 2备注信息"
222+
}
223+
]
224+
},
225+
// 有权限限制的数据表,通过 sql 字段来限制
226+
{
227+
"name": "数据表 2",
228+
"comment": "数据表 2 备注信息",
229+
"sql": "select name, gender, class, score from student where class = 1 and score > 80",
230+
"fields": [
231+
{
232+
"name": "name",
233+
"type": "TEXT",
234+
"comment": "姓名"
235+
},
236+
{
237+
"name": "class",
238+
"type": "int",
239+
"comment": "字段 3备注信息"
240+
},
241+
{
242+
"name": "score",
243+
"type": "int",
244+
"comment": "字段 4备注信息"
245+
}
246+
]
247+
}
248+
]
249+
}
250+
]
251+
}
252+
```
253+
192254
api 接口可以考虑预留参数 dsId 以及 tableId,以限定数据源和表进行问数。在多数据源场景下,对提升执行速度以及准确率都有明显效果。
193255

194256
问数之前,SQLBot 会在宿主页面获取凭证信息调用 API,可以利用 param 类型的凭证作为参数,但是要保证实时更新页面中的凭证。比如设置一个限定数据源 ID 的参数。

0 commit comments

Comments
 (0)