[BUG]: planetscale-serverless fails every query with @planetscale/database 2.0 (execute no longer accepts params)

Author: cfleissner-evisionsCreated Sep 29, 2026Updated Sep 29, 2026

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.45.3 (the same code is on rc5 / 1.0.0-rc.5)

What version of drizzle-kit are you using?

0.31.11

Other packages

@planetscale/[email protected]

Describe the Bug

@planetscale/database 2.0.0 (published 2026-09-24) removed client-side parameter interpolation (planetscale/database-js#219). execute is now execute(query, options?), and it throws if it receives a second argument that is not { as, cast } or any third argument:

Query parameters are not supported: pass a complete SQL string and options to execute(query, options)

drizzle-orm/planetscale-serverless always calls client.execute(queryString, params, options), even when params is [], so every query fails on 2.0, including parameterless ones. The optional peer range is "@planetscale/database": ">=1.13", which admits 2.0, so package managers install 2.0 without a peer warning, and pnpm's autoInstallPeers picks it by default.

Reproduction (no database needed; fetch is stubbed):

javascript
// npm i [email protected] @planetscale/[email protected]
import { Client } from "@planetscale/database";
import { drizzle } from "drizzle-orm/planetscale-serverless";
import { mysqlTable, int } from "drizzle-orm/mysql-core";
import { eq } from "drizzle-orm";

const fetch = async () => ({
  ok: true, status: 200, statusText: "OK",
  text: async () => JSON.stringify({ session: {}, result: { fields: [], rows: [] } }),
});
const users = mysqlTable("users", { id: int("id").primaryKey() });
const db = drizzle(new Client({ host: "example.invalid", username: "u", password: "p", fetch }));

await db.select().from(users).where(eq(users.id, 42));
// DrizzleQueryError: Failed query: select `id` from `users` where `users`.`id` = ?
// cause: Query parameters are not supported: pass a complete SQL string and options to execute(query, options)

The request never reaches fetch. Calling client.execute("select 1", [], { as: "array" }) directly throws the same error.

Expected: either the PlanetScale driver works with @planetscale/database 2.x, or the peer range excludes 2.x so users get a peer-dependency warning instead of every query failing at runtime.

Suggested fix:

  1. Short term, cap the peer at >=1.13 <2 on main and rc5. PRs are linked below.
  2. Longer term, supporting 2.x means the driver has to send fully formed SQL. The PlanetScale README now points callers at sql-escaper (format(query, params)). Whether Drizzle should own client-side escaping for this driver, or render parameters another way, is a design decision for the maintainers, because PlanetScale removed interpolation specifically as a security footgun (see planetscale/database-js#218).

Source: drizzle-team/drizzle-orm