Documentation Index
Fetch the complete documentation index at: https://docs.cubby.pro/llms.txt
Use this file to discover all available pages before exploring further.
Building with Neon Postgres
Neon Postgres support is in beta. Some features may have known issues.
Prerequisites
- Cubby CLI installed and logged in (
cubby login) - Node.js 18 or later
- A Builder (19.99/mo) plan — Neon Postgres requires Builder or higher
Create Your App
Runcubby init and select the Next.js + Neon Postgres template:
nextjs-neon template and creates a project with:
cubby.yaml:
Understanding the Database
When you deploy withdatabase: { provider: neon }, Cubby provisions a Neon Postgres database automatically:
- One Neon project per user, with individual databases per app
DATABASE_URLandDIRECT_URLare injected into your app’s environment- Prisma uses the Neon serverless driver (
@prisma/adapter-neon) for WebSocket connections
Install and Develop
http://localhost:3000.
Define Your Data Model
Editprisma/schema.prisma to add your models:
Deploy
When you’re ready, deploy to Cubby:- Verification: Pre-build checks, AI review, and PWA auto-fix
- Cloud Build: Your Docker image is built in Google Cloud Build
- Database provisioning: Neon Postgres database is created (or reused on redeploy)
- Schema sync:
prisma db pushruns automatically to apply your schema - Container start: Your app goes live with
DATABASE_URLinjected
Working with Your Database
Cubby provides database management commands viacubby db:
Export Your Data
Create a Branch
List Branches
Take a Snapshot
List Snapshots
Prisma Schema Changes
When you change your Prisma schema and redeploy:- Update
prisma/schema.prismawith your changes - Run
cubby deploy - Cubby runs
prisma db pushautomatically during deploy
prisma db push applies schema changes non-destructively. It creates new tables and columns but does not drop existing data. For destructive changes (removing columns, renaming tables), you’ll need to handle the migration manually.
Differences from SQLite
| SQLite | Neon Postgres | |
|---|---|---|
| Tier | All tiers (including free) | Builder (19.99/mo) |
| Concurrent writes | Single writer | Multiple connections |
| Data location | Inside container (PVC) | External (Neon cloud) |
| Branching | Not available | cubby db branch |
| Snapshots | Not available | cubby db snapshot |
| Best for | Simple apps, prototypes | Complex queries, shared data, production apps |
Related
- Building Database Apps - SQLite and Prisma basics
cubby db- Database CLI reference- Pricing and Billing - Plan requirements for Neon
cubby init- Create a new app