Overview
Learn how Supabase provides PostgreSQL hosting for Plainform's database infrastructure.
Supabase serves as the PostgreSQL hosting provider for Plainform, offering a managed database instance that Plainform connects to via Prisma ORM. While Supabase offers many features (authentication, storage, real-time subscriptions), Plainform uses it solely as a PostgreSQL database host.
What Supabase Provides
Supabase hosts your PostgreSQL database and provides:
- Managed PostgreSQL Database: A fully managed PostgreSQL instance with automatic backups and scaling
- Connection Pooling: Built-in connection pooling via PgBouncer for better performance
- Dashboard Access: Web-based interface to view tables, run SQL queries, and manage your database
- Direct and Pooled Connections: Two connection strings for different use cases (migrations vs. queries)
How Plainform Uses Supabase
Plainform interacts with the Supabase-hosted PostgreSQL database exclusively through Prisma ORM:
- Database Queries: All CRUD operations use Prisma Client (not Supabase client)
- Schema Management: Database schema is defined in
prisma/schema.prisma - Migrations: Database migrations are managed via Prisma Migrate
- Type Safety: Prisma generates TypeScript types from your schema
This means you won't find @supabase/supabase-js in the codebase - Supabase is purely the hosting provider, while Prisma handles all database interactions.
Using Supabase Features (Optional)
While Plainform doesn't use Supabase's client library by default, you can add it if you want to leverage Supabase's additional features:
- Supabase Auth: Alternative to Clerk for authentication
- Supabase Storage: Alternative to AWS S3 for file storage
- Real-time Subscriptions: Live data updates for collaborative features
- Edge Functions: Serverless functions hosted on Supabase
- Row-Level Security (RLS): Database-level access control policies
To add Supabase client features:
npm install @supabase/supabase-jsThen create a Supabase client:
import { createClient } from '@supabase/supabase-js';
export const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);For detailed integration guides, see the Supabase Documentation.
Alternative PostgreSQL Providers
Since Plainform uses standard PostgreSQL via Prisma, you can easily switch to other PostgreSQL hosting providers:
- Vercel Postgres: Integrated with Vercel deployments
- Railway: Simple PostgreSQL hosting with automatic backups
- Neon: Serverless PostgreSQL with branching
- AWS RDS: Enterprise-grade managed PostgreSQL
- Self-hosted: Your own PostgreSQL instance
Simply update the DATABASE_URL and DIRECT_URL environment variables to point to your new provider.
Learn More
For database operations and Prisma usage, see the Database section. For Supabase-specific features beyond PostgreSQL hosting, consult the Supabase Documentation.
How is this guide ?
Last updated on