-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yaml
81 lines (78 loc) · 2.27 KB
/
openapi.yaml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
openapi: 3.0.1
info:
title: SingleStore SQrL Plugin
description: A plugin that allows the user to run SQL queries on a MySQL database (SingleStore) using ChatGPT.
version: 'v1'
servers:
- url: http://localhost:5003
paths:
/sql_query:
post:
operationId: executeSqlQuery
summary: Execute a SQL query
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
sql_query:
type: string
description: The SQL query to execute.
required: true
db_name:
type: string
description: The name of the database to execute the query on.
required: true
responses:
"200":
description: OK
/table_shape:
get:
operationId: getTableShape
summary: Get the table names and column names. Necessary to determine the correct table/column names, so run this whenever you are unsure.
responses:
content:
application/json:
schema:
$ref: '#/components/schemas/getTableShapeResponse'
/credentials:
post:
operationId: saveCredentials
summary: Save database credentials
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
username:
type: string
description: The database username.
required: false
password:
type: string
description: The database password.
required: false
endpoint_url:
type: string
description: The endpoint url of the database.
required: false
components:
schemas:
tableShapeResponse:
type: object
properties:
todos:
type: array
items:
type: string
description: The list of column names, grouped by database name.
sql_query:
type: object
properties:
sql_query:
type: string
description: The SQL query to execute.