POST /metadata

Description: Retrieves metadata (Table and Column details) from the database based on the provided Connection details.

Request Body:

  • Description: A JSON object with connection details to the database.

Example Request:

{
  "id": "2",
  "name": "Chinook",
  "host": "localhost",
  "port": 5432,
  "user": "postgres",
  "password": "test",
  "database": "chinook",
  "type": "POSTGRES"
}

Response:

  • 200 OK:

    • Type: Table[]

    • Body: A JSON array of Table objects, each containing columns.

  • 500 Internal Server Error:

    • Type: SQLError

    • Body:

CURL Example:

curl -X POST http://localhost:3000/metadata \
  -H "Content-Type: application/json" \
  -d '{
        "id": "2",
        "name": "Chinook",
        "host": "localhost",
        "port": 5432,
        "user": "postgres",
        "password": "test",
        "database": "chinook",
        "type": "POSTGRES"
    }'

Last updated