Skip to main content

Get Column List

Query columns by table name.

Endpoint: /openapi/v1/metadata/column/list

Method: GET

Request parameters

ParameterTypeRequiredDescriptionExample
datasourceIdStringYesData source ID. Call Retrieve Data Source List to get the value.ds-d92qvqp8o1fw
databaseNameStringYesDatabase name. Call Get Database List to get the value.9zcloud
schemaNameStringNoSchema name. Call Get Schema List to get the value.public
tableNameStringYesTable name. Call Get Table List to get the value.pgbench_accounts

Response parameters

ParameterTypeDescriptionExample
successBoolWhether the call succeeded. Values: true or false.true
requestIdStringRequest ID.Ax8w2SHX-DJGGjUVnEJLj1YCdGFq2ZEZ
dataArrayColumn list. Items may include columnName, columnComment, dataType, length, scale, unsigned, nullable, charsetName, collationName, ordinalPosition, and columnDefault.{"columnName":"id","dataType":"bigint"}

Column details

Each column object in data may contain the following fields.

ParameterTypeDescriptionExample
columnNameStringColumn name.id
columnCommentStringColumn comment.Primary key
dataTypeStringColumn data type, such as varchar.bigint
lengthLongColumn length.20
scaleLongData precision. For floating-point and Numeric types, this is the length of the fractional part.0
unsignedBooleanWhether the column is unsigned.false
nullableBooleanWhether the column accepts null.true
charsetNameStringCharacter set.utf8mb4
collationNameStringCollation.utf8mb4_general_ci
ordinalPositionIntegerColumn position.1
columnDefaultStringColumn default value.null

Successful response

{
"success": true,
"requestId": "Ax8w2SHX-DJGGjUVnEJLj1YCdGFq2ZEZ",
"data": [
{
"columnName": "id",
"dataType": "bigint",
"length": 64,
"scale": 0,
"unsigned": false,
"nullable": true,
"ordinalPosition": 0
}
]
}