type alias PrismaSqlProvider
Since 0.2.0

The SQL connector a Prisma client is bound to.

Only contains is connector-sensitive in the Prisma adapter, and only because the escaping it applies is correct solely on connectors whose LIKE defaults the escape character to backslash. The three groups are:

  • Escaped (postgresql/postgres, mysql, sqlserver, cockroachdb) — LIKE-based with a backslash default escape, so the value is escaped.
  • Passed through (mongodb) — contains compiles to a $regex match in which % and _ are already literal, so escaping them would be wrong. This arm is unreachable on Prisma v7: a Prisma client for MongoDB cannot be constructed (generation succeeds, construction fails — MongoDB did not make the Prisma 7 release and returns in Prisma 8). It is retained because it is a published export (AI_GUIDELINES §9.2), and the reasoning stays correct for any future Prisma-Mongo client. The supported MongoDB route is the 'mongodb' adapter arm (MongoDatabaseOptions).
  • Refused (sqlite) — LIKE-based with no default escape character and no ESCAPE clause from Prisma, so a literal contains is inexpressible.

'postgres' is accepted alongside 'postgresql' because the schema spells it the long way while the driver adapter reports the short one. An application whose connector cannot be detected passes provider explicitly rather than have the adapter guess.

Definition

"postgresql"
| "postgres"
| "mysql"
| "sqlserver"
| "cockroachdb"
| "mongodb"
| "sqlite"

Usage

import { type PrismaSqlProvider } from "database-plugin/src/index.ts";