Skip to content

Render

PerSQL gives a Render service its own SQLite database on the edge. You provision a database, set three environment variables, and query with the PerSQL SDK. Every Render preview environment can get its own isolated branch database.

  1. Go to render.persql.com/connect, sign in, and provision a database. You get three values:

    VariableExampleSecret
    PERSQL_API_URLhttps://api.persql.comno
    PERSQL_DATABASE<namespace>/<db-slug>no
    PERSQL_TOKENpsql_live_…yes

    The token is admin-scoped to that one database (so your app can run its own migrations) and nothing else.

  2. Set them on your service under Environment, or share them across services with an Environment Group.

  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");

The render-starter repo is a minimal web service backed by PerSQL, with a render.yaml Blueprint that declares the three variables as prompted (sync: false) values:

Deploy to Render

Click it, then paste the values from the connect page when Render prompts.

Point a coding agent at the Render MCP for the per-PR recipe:

https://render.persql.com/mcp

Authenticate with a PerSQL bearer token. preview_recipe returns the CI snippet that spawns a preview-pr-<n> branch when a preview environment opens and deletes it on close; preview_list shows the active previews.