-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql-select-query-example.json
More file actions
34 lines (34 loc) · 1.1 KB
/
sql-select-query-example.json
File metadata and controls
34 lines (34 loc) · 1.1 KB
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
{
"title": "Execute a Parameterized SELECT Query",
"description": "Example of executing a parameterized SQL SELECT query via a database HTTP API",
"request": {
"method": "POST",
"url": "https://api.example-db-service.com/v1/query",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
"body": {
"sql": "SELECT id, name, email, created_at FROM users WHERE active = $1 ORDER BY name LIMIT $2",
"parameters": [true, 50],
"timeout": 10000
}
},
"response": {
"status": 200,
"body": {
"columns": [
{ "name": "id", "type": "INTEGER", "nullable": false, "primaryKey": true },
{ "name": "name", "type": "VARCHAR", "nullable": false },
{ "name": "email", "type": "VARCHAR", "nullable": true },
{ "name": "created_at", "type": "TIMESTAMP", "nullable": false }
],
"rows": [
[1, "Alice Smith", "alice@example.com", "2024-01-15T10:30:00Z"],
[2, "Bob Jones", "bob@example.com", "2024-02-20T14:00:00Z"]
],
"rowCount": 2,
"executionTime": 5.3
}
}
}