API Reference

@planetscale/database

MySQL driver for serverless JavaScript using the Vitess HTTP API, with prepared queries and transaction support.

Official Documentation ↗
CompatibilityThis documentation covers version v2.0.0. Check the official docs for the latest API surface.

Installation

npmnpm install @planetscale/database

Methods

@planetscale/database is mysql driver for serverless javascript using the vitess http api, with prepared queries and transaction support. This page documents the core methods, installation, and common usage patterns for the current stable release.

Installation

Install @planetscale/database with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.

Core methods

The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v1.13 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.

Frequently asked questions

The faq section in the frontmatter answers the most common questions about @planetscale/database, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.

FAQ

Is it compatible with mysql2?
It is a standalone driver; use @planetscale/prisma for Prisma or kysely-planetscale for Kysely.
Does it support connection pooling?
No. Each query is independent over HTTP; the platform handles pooling server-side.
Can I use it in Cloudflare Workers?
Yes. It uses fetch under the hood and works in any edge runtime.