Actions27
- Database Actions
- Storage Actions
Database → Add Column
AI-generatedSummary
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' }