Get a database table overview

List readable registered tables and column names in the specified database.

POST https://api.moi.matrixorigin.cn/v5/table/database/tables

Before you call this API

BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.

Obtain the target database ID. Prepare a personal access token with workspace access and read access to target tables, plus a workspace ID. BASE_URL includes the same environment’s product prefix. MOI_KEY and WORKSPACE_ID are product credentials and workspace ID. Example IDs/data are placeholders.

Request body

curl --fail-with-body -sS -X POST "$BASE_URL/table/database/tables" \
  -H "X-API-Key: $MOI_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"database_id": 10}'

Fields

Type

Required

Description

database_id

integer

Yes

Positive integer database ID.

A registered table may still return when physical schema is missing, with col_names=[]. This differs from missing-table handling in workspace-wide overviews.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "tables": [
      {
        "db_name": "sales",
        "table_name": "orders",
        "col_names": [
          "id",
          "amount"
        ]
      }
    ]
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.tables

object[] (array of objects) or null

Table overviews in the database; may be null without results.

data.tables[].db_name

string

Database name.

data.tables[].table_name

string

Registered table name.

data.tables[].col_names

string[] (array of strings)

Column names. Empty array if physical schema is missing; a physical column collection may also be null.

Error response

{
  "code": "ErrParamInvalid",
  "msg": "示例错误信息"
}

HTTP

code

Condition

400

ErrParamInvalid

Invalid database ID.

404

ErrNotFound

Database does not exist.

Use actual returned code, msg, and diagnostic fields for identity, permission, and dependency failures. Error text may vary by language.

Last updated on