Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

aviraccoon/prisma-datetime-cursor-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prisma: compound cursor with DateTime returns 0 rows via driver adapter

Bug

When using @prisma/adapter-mariadb (driver adapter), a findMany with a compound cursor containing a DateTime field returns 0 rows. The equivalent WHERE-based query returns the correct results.

Reproduce

bun install
bunx prisma generate
bunx prisma db push --url "mysql://root@127.0.0.1:3306/cursor_repro"
bun repro.ts

Update the connection details in repro.ts and the --url flag for your MySQL instance.

Output

Seeded 10 rows for appId=1

Cursor row: { appId: 1, createdAt: 2025-01-03T00:00:00.000Z }

--- Test 1: Compound cursor with DateTime (via adapter) ---
Result: 0 rows (expected: 3)

--- Test 2: WHERE-based equivalent (works) ---
Result: 3 rows (expected: 3)
Rows: [ '2025-01-04', '2025-01-05', '2025-01-06' ]

Environment

  • Prisma 7.4.2
  • @prisma/adapter-mariadb 7.4.2
  • MySQL 8.0
  • macOS, bun 1.x

Notes

  • Both Date objects and ISO strings fail as cursor values.
  • The cursor subquery reaches the database but the DateTime comparison silently returns no matches.
  • The generated SQL uses a subquery for cursor positioning that fails with DateTime values.

About

Minimal repro: Prisma 7 compound cursor with DateTime returns 0 rows via driver adapter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors