Skip to content

Commit c135f83

Browse files
committed
docs: add edge environments section to README
- Document tableName option for edge deployments - Explain automatic snake_case fallback behavior - Related to #12
1 parent 6ad2175 commit c135f83

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ main();
115115

116116
## Advanced usage
117117

118+
### Edge Environments
119+
120+
When using this library in edge environments (Cloudflare Workers, Vercel Edge Functions, etc.) where Prisma's DMMF (Datamodel Meta Format) may not be available, you should explicitly provide the `tableName` option:
121+
122+
```ts
123+
export const emailQueue = createQueue<JobPayload, JobResult>(
124+
{
125+
name: "email",
126+
tableName: "queue_job", // Explicit table name for edge environments
127+
},
128+
async (job, client) => {
129+
// ...
130+
},
131+
);
132+
```
133+
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.
135+
118136
### Threading
119137

120138
You can easily spin of your workers in separate threads using [worker_threads](https://nodejs.org/api/worker_threads.html#worker-threads) (Node.js >= 12.17.0).

0 commit comments

Comments
 (0)