Skip to content

Vercel

PerSQL gives each Vercel project its own SQLite database on the edge. Unlike the Railway and Render integrations, you don’t paste anything: the integration writes the environment variables for you across production, preview, and development, and every preview deployment gets its own isolated branch database.

  1. Go to vercel.persql.com/install/start (or add PerSQL from your Vercel dashboard), authorize it, and pick the projects to connect to your PerSQL workspace.

  2. PerSQL provisions a database per project and sets three variables on each, across all environments — nothing to copy:

    VariableExample
    PERSQL_API_URLhttps://api.persql.com
    PERSQL_DATABASE<namespace>/<db-slug>
    PERSQL_TOKENpsql_live_… (admin-scoped to that one database)
  3. Query:

    import { PerSQL } from "@persql/sdk";
    const db = new PerSQL({
    token: process.env.PERSQL_TOKEN,
    baseURL: process.env.PERSQL_API_URL,
    }).database(process.env.PERSQL_DATABASE);
    const { data } = await db.query("SELECT 1 AS ok");

Every Vercel preview deployment forks an isolated branch database, so previews never share state with production. Point a coding agent at the Vercel MCP for the CI recipe:

https://vercel.persql.com/mcp

Authenticate with a PerSQL bearer token. preview_recipe returns the snippet that spawns a preview-pr-<n> branch per preview and cleans it up on close; preview_list shows the active previews.