Commit 2967cdb
committed
fix(run-store): fix batch idempotency lookup on the dedicated run-ops store
findRunsByIdempotencyKeys built its UNION ALL of per-key point-lookups with
@trigger.dev/database's Prisma.sql/Prisma.join and then ran it on whichever
store client it was handed. On the dedicated run-ops store that client is a
separate generated Prisma client, and a Sql from a different generated client
is not recognized: the bare $queryRaw(Prisma.join(...)) form dropped the query
text ("Argument query is missing"), so batchTrigger requests carrying any
per-item idempotencyKey failed.
Rebuild the lookup as a plain parameterized string via $queryRawUnsafe (static
SQL + integer placeholders, all values bound), so it no longer depends on which
generated client executes it. Same per-key point-lookup shape; no change on the
single-client path.1 parent 80cbc46 commit 2967cdb
2 files changed
Lines changed: 16 additions & 4 deletions
File tree
- .server-changes
- internal-packages/run-store/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
1691 | 1692 | | |
1692 | 1693 | | |
1693 | 1694 | | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1697 | 1704 | | |
1698 | | - | |
1699 | 1705 | | |
1700 | 1706 | | |
1701 | 1707 | | |
| |||
0 commit comments