Supabase Extended icon

Supabase Extended

Interact with Supabase database and storage

Database → Add Column

AI-generated

Summary

Add a new column to an existing database table in Supabase via an ALTER TABLE command executed through an RPC call.

Inputs

  • tableName (required) — Name of the database table to modify.
  • columnDefinition (required) — Object containing the column specifications: 'name', 'type', optional 'nullable' (boolean), and optional 'defaultValue'.

Output shape

a single record

Returns an object containing operation status, table name, column name, executed SQL string, and a success boolean. Requires the exec_sql RPC function to be configured in Supabase.

Examples

Example 1: Add an active boolean flag to users table

Table Name: users, Column Definition: { name: 'is_active', type: 'boolean', nullable: false, defaultValue: 'true' }

Links

Discussion