创建 SQL 文件

在 TEM 中,SQL 语句可以保存在 SQL File 中,方便后续获取出来反复执行。对于 SQL file,有两种方式可以创建:

1. 直接创建 SQL 文件(当前接口)
2. 上传本地 SQL 文件(请查看“创建 SQL 文件“接口)

接口URL

/api/v1/dms/sqleditor/sqlFile

请求方式

POST

Content-Type

application/json

认证方式

Bearer auth

请求Body参数

{
    "clusterID": "tidb-f91e1f860d360502",
    "content": "SELECT * FROM regions;INSERT INTO regions(region_id,region_name) VALUES (6,'南极洲');",
    "database": "test",
    "name": "SQL File 100",
    "userID": "haibo"
}
参数名 示例值 参数类型 是否必填 参数描述
clusterID - String 集群 ID
content - String SQL 文件内容
database - String 所在库
name - String 文件名
userID - String 创建者 ID

成功响应示例

{
    "Data": {
        "id": "sqlfile-3829726912960944"
    },
    "Success": true
}
参数名 示例值 参数类型 参数描述
code - String
data.id - String SQL 文件 ID
message - String
success - Boolean
© 2024 平凯星辰(北京)科技有限公司 all right reserved,powered by GitbookFile Modify: 2024-04-02 15:37:04

results matching ""

    No results matching ""