PerSQL / Netlify

PerSQL for Netlify

Edge SQLite for your Netlify sites.

An isolated database per site, a branch per Deploy Preview. Provision one, set three environment variables, and query with the SDK.

How it works

1

Connect

Sign in and provision an isolated SQLite database in your namespace.

2

Set three vars

Paste PERSQL_TOKEN, PERSQL_DATABASE, PERSQL_API_URL under Site configuration → Environment variables, or set them team-wide.

3

Query

Read the vars with @persql/sdk in a Netlify Function and run SQL. Deploy Previews get their own branch.

Then query it

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 Deploy Preview

Point a coding agent at the Netlify MCP. preview_recipe returns the CI snippet that spawns a preview-pr-<n> branch during a Netlify Deploy Preview build and cleans it up on close.

https://netlify.persql.com/mcp

Authenticate with a PerSQL bearer token. Tools: preview_list, preview_recipe.