Supabase Extended icon

Supabase Extended

Interact with Supabase database and storage

Database → Create Table

AI-generated

Summary

Creates a new table in the Supabase database with the specified name and column definitions.

Inputs

  • tableName (required) — Name of the table to create (must start with a letter and contain only letters, numbers, and underscores, max 63 characters).
  • columnDefinitions (required) — Fixed collection of column definitions. Each column must provide a name and type, and may optionally set nullable (default true), defaultValue, primaryKey, and unique flags.

Output shape

Array of objects, one per input item.

Each object contains a JSON payload with fields: operation ('createTable'), tableName, sql (the executed CREATE TABLE statement), and success (true).

Examples

Example 1: Create a simple users table

tableName: 'users'; columnDefinitions: [{name: 'id', type: 'uuid', primaryKey: true}, {name: 'email', type: 'text', nullable: false, unique: true}, {name: 'created_at', type: 'timestamp', defaultValue: 'now()'}]

Links

Discussion