Skip to content

Commit 52305f1

Browse files
committed
docs: update README for breaking changes and edge environment behavior
Fix stale queue_job example to queue_jobs, document that DMMF-missing environments now require explicit tableName, and add migration guide for all breaking changes.
1 parent 95f391e commit 52305f1

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ When using this library in edge environments (Cloudflare Workers, Vercel Edge Fu
123123
export const emailQueue = createQueue<JobPayload, JobResult>(
124124
{
125125
name: "email",
126-
tableName: "queue_job", // Explicit table name for edge environments
126+
tableName: "queue_jobs", // Explicit table name for edge environments
127127
},
128128
async (job, client) => {
129129
// ...
130130
},
131131
);
132132
```
133133

134-
The library will automatically fall back to a snake_case conversion of the model name (e.g., `QueueJob``queue_job`) if DMMF is unavailable, but providing `tableName` explicitly is recommended for edge deployments.
134+
The library will throw an error if DMMF is unavailable and no `tableName` is provided. In edge environments, always provide `tableName` explicitly.
135135

136136
### Threading
137137

@@ -222,6 +222,15 @@ parentPort?.postMessage(result);
222222
process.exit(0);
223223
```
224224

225+
## Migration Guide
226+
227+
### Breaking Changes (v2)
228+
229+
- **Worker receives transactional client**: The worker callback's second parameter is now the Prisma transactional client (`PrismaLightClient`) instead of the root `PrismaClient`. Operations like `$transaction`, `$connect`, `$disconnect`, `$on`, `$use`, or `$extends` are not available inside the worker — perform those outside the worker.
230+
- **`alignTimeZone` option removed**: This option was deprecated and has been removed. Timezone alignment is no longer needed.
231+
- **`transactionTimeout` option added**: Defaults to 30 minutes (was hardcoded at 24 hours). Configure via the `transactionTimeout` option in milliseconds.
232+
- **Edge environments require explicit `tableName`**: The library no longer guesses the table name when DMMF is unavailable. Provide the `tableName` option explicitly.
233+
225234
## Authors
226235

227236
- [Olivier Louvignes](https://github.com/mgcrea) <<olivier@mgcrea.io>>

0 commit comments

Comments
 (0)