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

FeaturePrisma supportsPostgreSQLSQLiteNotes
Model methods
findManyPostgreSQL, SQLiteAcceleratedAcceleratedCompiled to SQL.
findFirstPostgreSQL, SQLiteCan differCan differCompiled with LIMIT 1. cursor and negative take are ignored. distinct falls back.
findUniquePostgreSQL, SQLitePartialPartialCompound unique keys such as a_b: { a, b } fall back.
findUniqueOrThrow, findFirstOrThrowPostgreSQL, SQLiteRuns in PrismaRuns in PrismaNot intercepted.
countPostgreSQL, SQLiteCan differCan differselect: { _all, field } is ignored and a number is returned instead of an object. Negative take falls back.
aggregatePostgreSQL, SQLiteCan differCan differtake, skip, cursor and orderBy are ignored, so totals can differ.
groupByPostgreSQL, SQLitePartialPartialby as a single string falls back. Ordering by an aggregate is expected to fall back (not verified).
create, createMany, createManyAndReturnPostgreSQL, SQLiteRuns in PrismaRuns in PrismaWrites are not intercepted.
update, updateMany, updateManyAndReturnPostgreSQL, SQLiteRuns in PrismaRuns in PrismaWrites are not intercepted.
upsert, delete, deleteManyPostgreSQL, SQLiteRuns in PrismaRuns in PrismaWrites are not intercepted.
findManyStream, findManyReduceStreamNoprisma-sql onlyNot availableRow streaming. PostgreSQL only; SQLite throws.
Query options
selectPostgreSQL, SQLiteAcceleratedAcceleratedScalars, relations and _count. Unknown fields fall back.
includePostgreSQL, SQLiteAcceleratedAcceleratedQueries over the depth, fan-out or circular-include limits fall back.
omit (per query)PostgreSQL, SQLiteCan differCan differIgnored. Omitted fields are returned.
omit (client option)PostgreSQL, SQLiteCan differCan differNot read. Fields omitted in new PrismaClient({ omit }) are returned.Inferred from the source; not confirmed by a test run.
distinctPostgreSQL, SQLiteCan differPartialPostgreSQL 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, skipPostgreSQL, SQLiteAcceleratedAccelerated
Negative takePostgreSQL, SQLitePartialPartialNeeds orderBy on selected scalar fields; otherwise falls back.
cursorPostgreSQL, SQLiteCan differCan differWhen the cursor row does not exist, rows are returned; Prisma returns an empty list. Without orderBy, row order is not fixed.
relationLoadStrategyPostgreSQL (preview)AcceleratedNot in PrismaIgnored. The prisma-sql planner chooses how relations load.
_count in select / includePostgreSQL, SQLiteAcceleratedAcceleratedFiltered counts supported. Root _count: true may also count to-one relations (not verified).
Nested where, take, skipPostgreSQL, SQLiteAcceleratedAccelerated
Nested orderByPostgreSQL, SQLitePartialPartialScalar fields only. Relation fields fall back.
Nested cursor, distinctPostgreSQL, SQLiteCan differCan differApplied to one batched child query across all parents, not per parent.Inferred from the source; not confirmed by a test run.
Filters
equals, shorthand equalityPostgreSQL, SQLiteAcceleratedAccelerated
notPostgreSQL, SQLiteAcceleratedAcceleratedNULL rows are excluded, as in Prisma.
in, notInPostgreSQL, SQLiteAcceleratedAcceleratedEmpty lists behave as in Prisma.
lt, lte, gt, gtePostgreSQL, SQLiteAcceleratedAcceleratedA null value falls back.
contains, startsWith, endsWithPostgreSQL, SQLiteAcceleratedAccelerated% and _ are not escaped, as in Prisma.
mode: 'insensitive'PostgreSQLAcceleratedNot in PrismaPostgreSQL uses ILIKE. On SQLite, where Prisma rejects mode, prisma-sql accepts it and uses LOWER().
search (full-text)PostgreSQL (preview)Falls backNot in Prisma
AND, OR, NOTPostgreSQL, SQLiteAcceleratedAcceleratedEmpty OR matches nothing, as in Prisma.
some, every, nonePostgreSQL, SQLiteAcceleratedAccelerated
is, isNotPostgreSQL, SQLiteCan differCan differWhen both are given, isNot is dropped.
Scalar lists: has, hasSome, hasEvery, isEmpty, equalsPostgreSQLPartialNot in Prismanot accepts only { equals }. isEmpty treats NULL lists as empty.
Json path filter { path, equals }PostgreSQLFalls backFalls back
Json string_contains, string_starts_with, string_ends_withPostgreSQLCan differCan differAlways case-insensitive and matched against the whole JSON text.
Json array_contains, array_starts_with, array_ends_withPostgreSQLFalls backFalls back
DbNull, JsonNull, AnyNullPostgreSQL, SQLiteCan differCan differThe filter may be dropped.Inferred from the source; not confirmed by a test run.
Field references (model.fields.x)PostgreSQL, SQLiteFalls backFalls backInferred from the source; not confirmed by a test run.
Compound unique wherePostgreSQL, SQLiteFalls backFalls back
null, undefinedPostgreSQL, SQLiteAcceleratedAcceleratedundefined is skipped, as in Prisma.
Decimal and Bytes valuesPostgreSQL, SQLiteFalls backFalls backInferred from the source; not confirmed by a test run.
Enum valuesPostgreSQL, SQLiteAcceleratedAcceleratedMapped to @map names.
Ordering
Scalar asc / descPostgreSQL, SQLiteAcceleratedAccelerated
{ sort, nulls }PostgreSQL, SQLiteAcceleratedAcceleratedSQLite emulates NULLS FIRST / LAST.
Relation fieldPostgreSQL, SQLiteAcceleratedAcceleratedTo-one relations, nested.
Relation _countPostgreSQL, SQLiteFalls backFalls back
_relevancePostgreSQL (preview)Falls backNot in Prisma
groupBy by aggregatePostgreSQL, SQLiteFalls backFalls backInferred from the source; not confirmed by a test run.
Optional relation { sort, nulls }Noprisma-sql onlyprisma-sql onlyType extension added by prisma-sql. Throws instead of falling back when unsupported.
Aggregates
_count, _sum, _avg, _min, _maxPostgreSQL, SQLiteAcceleratedAccelerated
groupBy havingPostgreSQL, SQLiteAcceleratedAcceleratedequals, not, gt, gte, lt, lte, in, notIn. Other operators fall back.
groupBy take, skipPostgreSQL, SQLiteAcceleratedAcceleratedAccepted without orderBy; Prisma requires it.
aggregate take, skip, cursor, orderByPostgreSQL, SQLiteCan differCan differIgnored.
_count: true result shapePostgreSQL, SQLiteCan differCan differReturns { _all: n }; Prisma returns n.Inferred from the source; not confirmed by a test run.
Client API
$transaction(async (tx) => …)PostgreSQL, SQLiteRuns in PrismaRuns in PrismaRuns on the base client. Reads inside the callback are not accelerated.
$transaction([…])PostgreSQL, SQLiteCan differCan differAccelerated 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 }])Noprisma-sql onlyNot availableprisma-sql form with isolation level and timeout. PostgreSQL only.
$queryRaw, $executeRawPostgreSQL, SQLiteRuns in PrismaRuns in Prisma
$queryRawTyped (TypedSQL)PostgreSQL, SQLite (preview)Runs in PrismaRuns in PrismaInferred from the source; not confirmed by a test run.
findUnique batchingPostgreSQL, SQLiteNot availableNot availableEach findUnique runs its own SQL query.
log, $on('query')PostgreSQL, SQLitePartialPartialAccelerated queries do not reach Prisma logs. Use debug or onQuery.Inferred from the source; not confirmed by a test run.
$batch, $batchCountNoprisma-sql onlyNot availableSeveral reads in one round trip. BigInt and Decimal come back as JS numbers.
createShardedReaderNoprisma-sql onlyprisma-sql onlyReturns raw rows: no type conversion, no enum mapping.
Multiple schemas (@@schema)PostgreSQLNot availableNot in PrismaSchema is fixed to public.
Result types
DecimalPostgreSQL, SQLiteCan differNot checkedString on flat rows, number inside included relations. Aggregates return Prisma.Decimal.
BigIntPostgreSQL, SQLiteCan differNot checkedString on flat rows, number inside included relations. Aggregates return bigint.
DateTimePostgreSQL, SQLiteCan differCan differPostgreSQL: Date on flat rows, string inside included relations. SQLite: raw number or string.
BooleanPostgreSQL, SQLiteAcceleratedCan differSQLite returns 0 / 1.
BytesPostgreSQL, SQLiteCan differNot checkedBuffer on flat rows, hex string inside included relations.Inferred from the source; not confirmed by a test run.
JsonPostgreSQL, SQLiteAcceleratedCan differSQLite returns the raw JSON string when there is no include.
Enum with @mapPostgreSQL, SQLiteCan differCan differThe database value is returned, not the schema name.

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: true to 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.