Get Table List
Query tables by database name or, for three-level data sources, by schema name.
Endpoint: /openapi/v1/metadata/table/list
Method: GET
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasourceId | String | Yes | Data source ID. Call Retrieve Data Source List to get the value. | ds-d92qvqp8o1fw |
databaseName | String | Yes | Database name. Call Get Database List to get the value. | 9zcloud |
schemaName | String | No | Schema name. Call Get Schema List to get the value. | public |
current | Integer | No | Page number, starting from 1. The default is 1. | 1 |
pageSize | Integer | No | Page size. The default is 10. | 10 |
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
success | Bool | Whether the call succeeded. Values: true or false. | true |
requestId | String | Request ID. | Ww2k2GVI-DJGGvSDnEJKv3PFdHIp6ETC |
data | Array | Table list. Each item includes tableName. | {"tableName":"pgbench_accounts"} |
current | Integer | Current page number. | 1 |
pageSize | Integer | Page size. | 10 |
total | Integer | Total number of tables. | 4 |
Table details
Each table object in data may contain the following fields.
| Parameter | Type | Description | Example |
|---|---|---|---|
tableName | String | Table name. | pgbench_accounts |
tableComment | String | Table comment. | Account information |
engine | String | Table engine. | InnoDB |
charsetName | String | Character set. | utf8mb4 |
collationName | String | Collation. | utf8mb4_general_ci |
Successful response
{
"success": true,
"requestId": "Ww2k2GVI-DJGGvSDnEJKv3PFdHIp6ETC",
"data": [
{ "tableName": "pgbench_accounts" },
{ "tableName": "pgbench_branches" },
{ "tableName": "pgbench_history" },
{ "tableName": "pgbench_tellers" }
],
"current": 1,
"pageSize": 10,
"total": 4
}