DocsDatabasesPostgreSQL

Databases

PostgreSQL

Add a managed PostgreSQL database to any Repl in one click.

Managed PostgreSQL

Every Syvera project can have a managed PostgreSQL 16 database. It's provisioned in seconds and the connection string is automatically injected as an environment variable — no configuration required.

Creating a database

  1. Open your Repl
  2. Click the Database icon in the left sidebar
  3. Click Create a database

That's it. Syvera creates a PostgreSQL database and sets the DATABASE_URL environment variable.

Connecting in code

Using `pg` (Node.js)

js
import { Pool } from 'pg';
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const result = await pool.query('SELECT * FROM users');

Using Drizzle ORM

ts
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
const db = drizzle(new Pool({ connectionString: process.env.DATABASE_URL }));

Using Prisma

In schema.prisma, set the provider to postgresql. The DATABASE_URL env var is read automatically.

Schema browser

Open the Database panel to browse your tables, inspect column types, and run raw SQL queries — without leaving Syvera.

Backups & recovery

PlanBackup frequencyRetention
Free
CoreDaily7 days
ProDaily30 days
TeamsHourly90 days

To restore from a backup, go to Database → Backups and select a restore point.

Connecting from deployment

The database attached to your development Repl is separate from your production database. Go to Deploy → Database to provision a production database and inject its DATABASE_URL into your deployment environment.