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.
Add the integration
Section titled “Add the integration”-
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.
-
PerSQL provisions a database per project and sets three variables on each, across all environments — nothing to copy:
Variable Example PERSQL_API_URLhttps://api.persql.comPERSQL_DATABASE<namespace>/<db-slug>PERSQL_TOKENpsql_live_…(admin-scoped to that one database) -
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");
A database per preview deployment
Section titled “A database per preview deployment”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/mcpAuthenticate 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.