Cloudflare D1 icon

Cloudflare D1

Execute operations against Cloudflare D1 serverless databases. Supports structured operations (Insert, Select, Update, Delete), raw SQL queries, and can be used as a tool by AI Agents.

Table Management → Get Table Schema

AI-generated

Summary

Get table schema information

Inputs

  • databaseId (required) — The unique identifier of the Cloudflare D1 database.
  • schemaTable (required) — The table identifier; can be chosen from a list or entered by name.

Output shape

A schema definition object describing the table's columns, types, primary key, and nullability.

Returns a single schema object; if the table does not exist an error is raised; the object includes column details such as name, type, primary key, and nullability.

Examples

Example 1: Retrieve schema for a table named 'users' in a database with ID 'abc123'.

Set Database ID to 'abc123', Table to 'users' (list mode), and invoke Get Table Schema.

Example 2: Get schema for the 'orders' table using the table's name directly.

Set Database ID to the appropriate value, Table mode to 'name' with value 'orders', then execute Get Table Schema.

Discussion