Prisma parity map
Every Prisma Client feature we checked, and what prisma-sql does with it on PostgreSQL and SQLite. Checked against prisma-sql 1.93.0 and the Prisma ORM 7 Client reference.
- Accelerated
- Compiled to SQL and run through postgres.js or better-sqlite3.
- Partial
- Compiled to SQL; some argument shapes fall back to Prisma.
- Falls back
- The SQL builder rejects it and Prisma runs the query. Same result, no speedup.
- Runs in Prisma
- Not intercepted. Prisma Client runs it as before.
- Can differ
- Accelerated, but the result can differ from Prisma without an error.
- Not available
- Prisma supports it; prisma-sql has no equivalent.
- prisma-sql only
- Added by prisma-sql. Not part of the Prisma Client API.
- Not in Prisma
- Prisma does not support this on that database.
- Not checked
- Behavior on this database has not been checked yet.
Showing 73 of 73 features
| Feature | Prisma supports | PostgreSQL | SQLite | Notes |
|---|---|---|---|---|
| Model methods | ||||
| findMany | PostgreSQL, SQLite | Accelerated | Accelerated | Compiled to SQL. |
| findFirst | PostgreSQL, SQLite | Can differ | Can differ | Compiled with LIMIT 1. cursor and negative take are ignored. distinct falls back. |
| findUnique | PostgreSQL, SQLite | Partial | Partial | Compound unique keys such as a_b: { a, b } fall back. |
| findUniqueOrThrow, findFirstOrThrow | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | Not intercepted. |
| count | PostgreSQL, SQLite | Can differ | Can differ | select: { _all, field } is ignored and a number is returned instead of an object. Negative take falls back. |
| aggregate | PostgreSQL, SQLite | Can differ | Can differ | take, skip, cursor and orderBy are ignored, so totals can differ. |
| groupBy | PostgreSQL, SQLite | Partial | Partial | by as a single string falls back. Ordering by an aggregate is expected to fall back (not verified). |
| create, createMany, createManyAndReturn | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | Writes are not intercepted. |
| update, updateMany, updateManyAndReturn | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | Writes are not intercepted. |
| upsert, delete, deleteMany | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | Writes are not intercepted. |
| findManyStream, findManyReduceStream | No | prisma-sql only | Not available | Row streaming. PostgreSQL only; SQLite throws. |
| Query options | ||||
| select | PostgreSQL, SQLite | Accelerated | Accelerated | Scalars, relations and _count. Unknown fields fall back. |
| include | PostgreSQL, SQLite | Accelerated | Accelerated | Queries over the depth, fan-out or circular-include limits fall back. |
| omit (per query) | PostgreSQL, SQLite | Can differ | Can differ | Ignored. Omitted fields are returned. |
| omit (client option) | PostgreSQL, SQLite | Can differ | Can differ | Not read. Fields omitted in new PrismaClient({ omit }) are returned.Inferred from the source; not confirmed by a test run. |
| distinct | PostgreSQL, SQLite | Can differ | Partial | PostgreSQL uses DISTINCT ON; when orderBy does not start with the distinct fields, order and take can differ (not verified). SQLite with cursor falls back.Inferred from the source; not confirmed by a test run. |
| take, skip | PostgreSQL, SQLite | Accelerated | Accelerated | |
| Negative take | PostgreSQL, SQLite | Partial | Partial | Needs orderBy on selected scalar fields; otherwise falls back. |
| cursor | PostgreSQL, SQLite | Can differ | Can differ | When the cursor row does not exist, rows are returned; Prisma returns an empty list. Without orderBy, row order is not fixed. |
| relationLoadStrategy | PostgreSQL (preview) | Accelerated | Not in Prisma | Ignored. The prisma-sql planner chooses how relations load. |
| _count in select / include | PostgreSQL, SQLite | Accelerated | Accelerated | Filtered counts supported. Root _count: true may also count to-one relations (not verified). |
| Nested where, take, skip | PostgreSQL, SQLite | Accelerated | Accelerated | |
| Nested orderBy | PostgreSQL, SQLite | Partial | Partial | Scalar fields only. Relation fields fall back. |
| Nested cursor, distinct | PostgreSQL, SQLite | Can differ | Can differ | Applied to one batched child query across all parents, not per parent.Inferred from the source; not confirmed by a test run. |
| Filters | ||||
| equals, shorthand equality | PostgreSQL, SQLite | Accelerated | Accelerated | |
| not | PostgreSQL, SQLite | Accelerated | Accelerated | NULL rows are excluded, as in Prisma. |
| in, notIn | PostgreSQL, SQLite | Accelerated | Accelerated | Empty lists behave as in Prisma. |
| lt, lte, gt, gte | PostgreSQL, SQLite | Accelerated | Accelerated | A null value falls back. |
| contains, startsWith, endsWith | PostgreSQL, SQLite | Accelerated | Accelerated | % and _ are not escaped, as in Prisma. |
| mode: 'insensitive' | PostgreSQL | Accelerated | Not in Prisma | PostgreSQL uses ILIKE. On SQLite, where Prisma rejects mode, prisma-sql accepts it and uses LOWER(). |
| search (full-text) | PostgreSQL (preview) | Falls back | Not in Prisma | |
| AND, OR, NOT | PostgreSQL, SQLite | Accelerated | Accelerated | Empty OR matches nothing, as in Prisma. |
| some, every, none | PostgreSQL, SQLite | Accelerated | Accelerated | |
| is, isNot | PostgreSQL, SQLite | Can differ | Can differ | When both are given, isNot is dropped. |
| Scalar lists: has, hasSome, hasEvery, isEmpty, equals | PostgreSQL | Partial | Not in Prisma | not accepts only { equals }. isEmpty treats NULL lists as empty. |
| Json path filter { path, equals } | PostgreSQL | Falls back | Falls back | |
| Json string_contains, string_starts_with, string_ends_with | PostgreSQL | Can differ | Can differ | Always case-insensitive and matched against the whole JSON text. |
| Json array_contains, array_starts_with, array_ends_with | PostgreSQL | Falls back | Falls back | |
| DbNull, JsonNull, AnyNull | PostgreSQL, SQLite | Can differ | Can differ | The filter may be dropped.Inferred from the source; not confirmed by a test run. |
| Field references (model.fields.x) | PostgreSQL, SQLite | Falls back | Falls back | Inferred from the source; not confirmed by a test run. |
| Compound unique where | PostgreSQL, SQLite | Falls back | Falls back | |
| null, undefined | PostgreSQL, SQLite | Accelerated | Accelerated | undefined is skipped, as in Prisma. |
| Decimal and Bytes values | PostgreSQL, SQLite | Falls back | Falls back | Inferred from the source; not confirmed by a test run. |
| Enum values | PostgreSQL, SQLite | Accelerated | Accelerated | Mapped to @map names. |
| Ordering | ||||
| Scalar asc / desc | PostgreSQL, SQLite | Accelerated | Accelerated | |
| { sort, nulls } | PostgreSQL, SQLite | Accelerated | Accelerated | SQLite emulates NULLS FIRST / LAST. |
| Relation field | PostgreSQL, SQLite | Accelerated | Accelerated | To-one relations, nested. |
| Relation _count | PostgreSQL, SQLite | Falls back | Falls back | |
| _relevance | PostgreSQL (preview) | Falls back | Not in Prisma | |
| groupBy by aggregate | PostgreSQL, SQLite | Falls back | Falls back | Inferred from the source; not confirmed by a test run. |
| Optional relation { sort, nulls } | No | prisma-sql only | prisma-sql only | Type extension added by prisma-sql. Throws instead of falling back when unsupported. |
| Aggregates | ||||
| _count, _sum, _avg, _min, _max | PostgreSQL, SQLite | Accelerated | Accelerated | |
| groupBy having | PostgreSQL, SQLite | Accelerated | Accelerated | equals, not, gt, gte, lt, lte, in, notIn. Other operators fall back. |
| groupBy take, skip | PostgreSQL, SQLite | Accelerated | Accelerated | Accepted without orderBy; Prisma requires it. |
| aggregate take, skip, cursor, orderBy | PostgreSQL, SQLite | Can differ | Can differ | Ignored. |
| _count: true result shape | PostgreSQL, SQLite | Can differ | Can differ | Returns { _all: n }; Prisma returns n.Inferred from the source; not confirmed by a test run. |
| Client API | ||||
| $transaction(async (tx) => …) | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | Runs on the base client. Reads inside the callback are not accelerated. |
| $transaction([…]) | PostgreSQL, SQLite | Can differ | Can differ | Accelerated reads can run on the prisma-sql connection, outside the Prisma transaction.Inferred from the source; not confirmed by a test run. |
| $transaction([{ model, method, args }]) | No | prisma-sql only | Not available | prisma-sql form with isolation level and timeout. PostgreSQL only. |
| $queryRaw, $executeRaw | PostgreSQL, SQLite | Runs in Prisma | Runs in Prisma | |
| $queryRawTyped (TypedSQL) | PostgreSQL, SQLite (preview) | Runs in Prisma | Runs in Prisma | Inferred from the source; not confirmed by a test run. |
| findUnique batching | PostgreSQL, SQLite | Not available | Not available | Each findUnique runs its own SQL query. |
| log, $on('query') | PostgreSQL, SQLite | Partial | Partial | Accelerated queries do not reach Prisma logs. Use debug or onQuery.Inferred from the source; not confirmed by a test run. |
| $batch, $batchCount | No | prisma-sql only | Not available | Several reads in one round trip. BigInt and Decimal come back as JS numbers. |
| createShardedReader | No | prisma-sql only | prisma-sql only | Returns raw rows: no type conversion, no enum mapping. |
| Multiple schemas (@@schema) | PostgreSQL | Not available | Not in Prisma | Schema is fixed to public. |
| Result types | ||||
| Decimal | PostgreSQL, SQLite | Can differ | Not checked | String on flat rows, number inside included relations. Aggregates return Prisma.Decimal. |
| BigInt | PostgreSQL, SQLite | Can differ | Not checked | String on flat rows, number inside included relations. Aggregates return bigint. |
| DateTime | PostgreSQL, SQLite | Can differ | Can differ | PostgreSQL: Date on flat rows, string inside included relations. SQLite: raw number or string. |
| Boolean | PostgreSQL, SQLite | Accelerated | Can differ | SQLite returns 0 / 1. |
| Bytes | PostgreSQL, SQLite | Can differ | Not checked | Buffer on flat rows, hex string inside included relations.Inferred from the source; not confirmed by a test run. |
| Json | PostgreSQL, SQLite | Accelerated | Can differ | SQLite returns the raw JSON string when there is no include. |
| Enum with @map | PostgreSQL, SQLite | Can differ | Can differ | The database value is returned, not the schema name. |
No features match. Clear the search or the status filters.
How this was checked
- Prisma behavior comes from the official Prisma ORM 7 Client reference and query guides, with Prisma 6 pages where the v7 pages are thin.
- prisma-sql behavior comes from reading its source, reviewed twice against the code. The row notes point out partial and differing behavior.
- Rows marked "inferred from the source" have no test run behind them yet.
- Anything marked "Falls back" still returns Prisma's result. Enable
debug: trueto log fallbacks, and runprisma-sql-verify to compare results on your own schema.
Databases
prisma-sql supports the postgresql and sqlite providers. Generation fails for MySQL, SQL Server, CockroachDB and MongoDB.
Prisma ORM 8
Prisma ORM 8 is a release candidate. According to Prisma's documentation, it replaces the generatedPrismaClient and $extends with a new query API, and $extends will not be added to it. prisma-sql hooks in through $extends, so this map covers the Prisma Client API of Prisma 6 and 7. The benchmarks labelled v8 use @prisma/client 8.1.0-dev.1.