Generate production-ready Supabase migrations from your Prisma schema in seconds. Zero config. Auto RLS policies, Realtime publications & Auth helpers.
No manual mapping. Point at your Prisma project and get Supabase-ready SQL instantly.
Row Level Security policies inferred from your model relations — production-ready from day one.
Publication setup for Supabase Realtime plus Auth integration helpers, included automatically.
No cloud dependency, no blocked domains, no AI hallucinations. Your schema never leaves your machine.
Get launch updates, the lifetime price locked in, and a say in what we build next.
| Feature | prisma-to-supabase | Prisma Migrate | Supabase CLI | AI Generators |
|---|---|---|---|---|
| Source of truth | ✓ schema.prisma | ✓ schema.prisma | ✗ SQL files | ✗ Prompt-based |
| Output format | ✓ Supabase CLI migrations | ✗ Prisma format | ✓ Supabase format | ✗ Inconsistent |
| RLS policies | ✓ Auto from relations | ✗ Manual | ✓ Manual/diff | ✗ Hallucinated |
| Realtime setup | ✓ Auto publications | ✗ Manual | ✓ Manual | ✗ Often missed |
| TypeScript types | ✓ Supabase-compatible | ✓ Prisma Client | ✗ Manual | ✗ Inconsistent |
| CI/CD friendly | ✓ No Docker needed | ✓ Standard | ✗ Needs Docker | ✗ Non-deterministic |
| Deterministic output | ✓ Same schema = same SQL | ✓ Yes | ✓ Yes | ✗ Never |
# 1. Install globally npm install -g prisma-to-supabase # 2. Run in your Prisma project npx prisma-to-supabase generate # 3. Get Supabase-ready migrations # → supabase/migrations/20240115_initial_schema.sql # → supabase/migrations/20240115_rls_policies.sql # → supabase/migrations/20240115_realtime_setup.sql # → supabase/migrations/20240115_auth_helpers.sql # → supabase/types/database.ts
-- Generated by prisma-to-supabase CREATE TABLE "user" ( "id" UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), "email" TEXT UNIQUE NOT NULL, "name" TEXT, "createdAt" TIMESTAMPTZ NOT NULL DEFAULT now(), "updatedAt" TIMESTAMPTZ NOT NULL ); CREATE TABLE "post" ( "id" UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), "title" TEXT NOT NULL, "published" BOOLEAN NOT NULL DEFAULT false, "authorId" TEXT NOT NULL REFERENCES "user"("id") );
-- Row Level Security Policies ALTER TABLE "post" ENABLE ROW LEVEL SECURITY; CREATE POLICY "Authors can view own posts" ON "post" FOR SELECT USING (auth.uid() = author_id); CREATE POLICY "Authors can insert own posts" ON "post" FOR INSERT WITH CHECK (auth.uid() = author_id); CREATE POLICY "Authors can update own posts" ON "post" FOR UPDATE USING (auth.uid() = author_id);
// Supabase-compatible types — generated
export interface User {
id: string;
email: string;
name?: string;
createdAt: Date;
updatedAt: Date;
}
export interface Database {
public: {
Tables: {
user: {
Row: User;
Insert: Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
Update: Partial<User>;
};
};
};
}