Skip to content

GitLab

PerSQL gives each GitLab merge request its own isolated SQLite branch database — real data for review apps that never touches production. The branch spawns when the MR opens and is cleaned up on merge or close.

  1. Go to gitlab.persql.com/install/start, authorize the app, and connect your projects to your PerSQL workspace.

  2. From then on, every MR gets a schema-only branch database named preview-mr-<iid> (for example preview-mr-57).

Point a coding agent at the GitLab MCP for the per-MR recipe:

https://gitlab.persql.com/mcp

Authenticate with a PerSQL bearer token. mr_recipe returns the .gitlab-ci.yml snippet that spawns or resets the MR’s branch and seeds it for the review app; mr_list shows the active ones. Run migrations and tests against the branch from your pipeline, then query it from the app:

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); // "<namespace>/preview-mr-57"
const { data } = await db.query("SELECT 1 AS ok");

When the MR merges or closes, the branch is dropped.