Skip to main content
Every Vybe app comes with its own PostgreSQL database powered by Neon. You do not need to provision, configure, or manage it — the AI handles everything from creating tables to writing queries based on your descriptions.

How it works

When you describe what your app needs, the AI automatically creates the database schema to support it. For example:
Create a table for tracking customer support tickets with status, priority, assignee, and timestamps.
The AI will:
  1. Create a tickets table with the appropriate columns and data types
  2. Add indexes for commonly queried fields
  3. Set up any necessary relationships to other tables
  4. Generate the API routes and UI components to work with the data
As your app evolves, the AI manages schema changes for you. If you ask to add a new column or create a relationship between tables, the AI modifies the schema and updates the relevant code automatically.
You can ask the AI to seed your database with sample data for testing. Try a prompt like: “Add 20 sample support tickets with realistic data.”

Schema visualization

The Data tab in the app editor includes an interactive ERD (Entity Relationship Diagram) that shows your complete database schema at a glance. The diagram displays:
  • All tables and their columns
  • Data types for each column
  • Primary keys and foreign key relationships
  • Relationship lines connecting related tables
The ERD updates automatically whenever the AI modifies your schema, so it always reflects the current state of your database.

Table browser

The Data tab also includes a table browser where you can work with your data directly. From the table browser, you can:
  • View rows in any table with sortable columns
  • Add rows by filling in a form for each column
  • Edit rows by clicking on a cell and modifying its value
  • Delete rows individually or in bulk
This is useful for inspecting data while building, verifying that the AI created the right schema, or manually adjusting records without writing SQL.

How the AI accesses the database

The AI generates server-side code to read and write data. Database queries always run on the server — in API routes or server components — never in client-side code. The AI typically uses a sql helper function for direct queries:
import { sql } from '@/lib/db';

export async function GET() {
  const tickets = await sql`
    SELECT * FROM tickets
    WHERE status = 'open'
    ORDER BY created_at DESC
  `;
  return Response.json(tickets);
}
For more complex data access patterns, the AI may use Prisma ORM:
import { prisma } from '@/lib/prisma';

export async function GET() {
  const tickets = await prisma.ticket.findMany({
    where: { status: 'open' },
    orderBy: { createdAt: 'desc' },
    include: { assignee: true },
  });
  return Response.json(tickets);
}
All database queries run server-side. The AI places them in Next.js API routes (app/api/...) or server components to keep your database credentials secure.

Working with your database through chat

You can ask the AI to perform database operations directly from the chat:
Show me all tickets created in the last 7 days.
Add a “priority” column to the tickets table with values: low, medium, high, critical.
Delete all test records from the users table where the email contains “example.com”.
The AI executes these operations and shows you the results inline. For destructive operations like deleting data or dropping tables, the AI will confirm before proceeding.

Best practices

  • Let the AI manage the schema. Describe what you need in plain language and let the AI create the tables, columns, and relationships. You can always refine with follow-up prompts.
  • Use the Data tab to verify. After the AI creates or modifies your schema, check the ERD and table browser to confirm everything looks right.
  • Seed data for testing. Ask the AI to generate realistic sample data so you can test your app’s UI and workflows before connecting real data.
  • Be specific about data types. If you need a column to be an enum, a timestamp, or a JSON field, mention it in your prompt. The AI will choose sensible defaults, but explicit instructions lead to better results.