superapp
BackendDatabases

PlanetScale

Connect to PlanetScale serverless MySQL.

Chat in Claude

Connect to PlanetScale using the serverless HTTP driver. Works on edge runtimes where TCP connections are unavailable.

import { createEngine } from '@superapp/backend'
import { planetscaleProvider } from '@superapp/backend/databases/planetscale'

const engine = createEngine({
  providers: [planetscaleProvider],
  connections: {
    main: { type: 'planetscale', connectionString: process.env.PLANETSCALE_URL! },
  },
})

Install

npm install @planetscale/database

Connection URL Format

mysql://username:password@host/database?ssl={"rejectUnauthorized":true}

Get your connection string from the PlanetScale dashboard under ConnectConnect with@planetscale/database.

Connection Options

OptionTypeDescription
connectionStringstringPlanetScale connection URL
hoststringPlanetScale host (alternative to URL)
usernamestringDatabase username
passwordstringDatabase password

On this page