JSON to Supabase Types
Paste a JSON object and instantly generate Supabase-compatible TypeScript interfaces with Row, Insert, and Update types.
Required for Insert?
export interface Database {
public: {
Tables: {
users: {
Row: {
id: string
email: string
full_name: string
avatar_url: string | null
is_active: boolean
role: string
login_count: number
metadata: { theme: string; notifications_enabled: boolean }
tags: string[]
created_at: string
updated_at: string
}
Insert: {
id?: string
email: string
full_name: string
avatar_url?: string | null
is_active: boolean
role: string
login_count: number
metadata: { theme: string; notifications_enabled: boolean }
tags: string[]
created_at?: string
updated_at?: string
}
Update: {
id?: string
email?: string
full_name?: string
avatar_url?: string | null
is_active?: boolean
role?: string
login_count?: number
metadata?: { theme: string; notifications_enabled: boolean }
tags?: string[]
created_at?: string
updated_at?: string
}
}
}
}
}
// Convenience type aliases
export type UsersRow = Database["public"]["Tables"]["users"]["Row"]
export type UsersInsert = Database["public"]["Tables"]["users"]["Insert"]
export type UsersUpdate = Database["public"]["Tables"]["users"]["Update"]Generating Supabase TypeScript Types from JSON
When working with Supabase, having accurate TypeScript types is essential for type-safe database queries. This tool converts a sample JSON row from your database into the exact format Supabase's CLI generates, including separate Row, Insert, and Update type definitions.
The Row type represents a full database row with all fields present. The Insert type makes auto-generated fields (like id, created_at) optional since the database provides defaults. The Update type makes all fields optional since you only send changed values.
The tool automatically detects TypeScript types from JSON values: strings, numbers, booleans, null, arrays, and nested objects. You can customize which fields are required for inserts using the toggle buttons below the JSON input.
Building a Supabase project? Our team builds type-safe Supabase backends with full RLS policies, edge functions, and real-time subscriptions.
Need a Type-Safe Supabase Backend?
We build production Supabase backends with generated types, RLS policies, edge functions, and real-time features. Let's discuss your project.
Get Started