# planetscale/database-js

A Fetch API-compatible PlanetScale database driver

Repository: https://github.com/planetscale/database-js
Canonical: https://ross.abutalabs.com/products/database-js
Homepage: https://planetscale.com/docs/tutorials/planetscale-serverless-driver
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: database, edge-computing, mysql, serverless, vercel
Last push: 2026-08-07T16:01:04+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 76, longevity 100
- inputs: {"age_days": 1498, "days_push": 26, "days_rel": 161, "gap_med": 1, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1198, forks 42 (observed 2026-08-28T04:03:57.612175+00:00)

## What it is
A Fetch API-compatible database driver for PlanetScale Vitess/MySQL databases, designed for serverless and edge compute platforms like Cloudflare Workers and Vercel Edge Functions. It executes SQL queries over HTTP instead of TCP, with support for transactions and connection factories.

## Use cases
- query a PlanetScale MySQL database from Cloudflare Workers
- connect to MySQL from Vercel Edge Functions where TCP is blocked
- run SQL transactions in serverless functions over HTTP
- execute parameterized queries against Vitess from JavaScript
- use a database URL to configure MySQL connections in edge runtimes

## When to choose
- deploying on edge/serverless platforms that disallow outbound TCP connections
- using PlanetScale Vitess/MySQL with JavaScript or TypeScript
- you need lightweight HTTP-based query execution without a persistent connection pool

## When to avoid
- connecting to a non-PlanetScale MySQL database
- you need raw TCP MySQL protocol features or full driver compatibility
- long-running servers where a traditional MySQL client with connection pooling is better

## Facets
- artifact type: library
- maturity: active
- function: database-driver, http-client
- domain: databases, backend, web-development
- platform: cloud, serverless, cross-platform
- tags: mysql, vitess, planetscale, edge-computing, fetch-api, typescript, serverless-database, serverless, nodejs

## Member repositories
- planetscale/database-js (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:57.612175+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:21:11.384694+00:00, confidence not recorded.
  - readme: https://github.com/planetscale/database-js (fetched 2026-08-28T04:03:57.612175+00:00, sha c42edd7f115d)
  - homepage: https://planetscale.com/docs/tutorials/planetscale-serverless-driver (fetched 2026-08-29T12:28:40.703256+00:00, sha 662e7cded19a)
  - site_page: https://planetscale.com/docs (fetched 2026-08-29T12:28:40.707711+00:00, sha 1348e3665507)
  - site_page: https://planetscale.com/docs/vitess (fetched 2026-08-29T12:28:40.709354+00:00, sha 5663c637c63f)
  - site_page: https://planetscale.com/docs/postgres (fetched 2026-08-29T12:28:40.710826+00:00, sha af3b62f4c6cb)
  - site_page: https://planetscale.com/docs/api/reference/getting-started-with-planetscale-api (fetched 2026-08-29T12:28:40.712244+00:00, sha dddc53013bd5)
  - site_page: https://planetscale.com/docs/cli (fetched 2026-08-29T12:28:40.713717+00:00, sha 8a2f8220c345)
  - site_page: https://planetscale.com/docs/vitess/pricing (fetched 2026-08-29T12:28:40.715571+00:00, sha f12bda322323)
  - site_page: https://planetscale.com/docs/vitess/tutorials/planetscale-serverless-driver-node-example (fetched 2026-08-29T12:28:40.717323+00:00, sha 3685e79b8dd0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
