File tree Expand file tree Collapse file tree 1 file changed +1
-30
lines changed
Expand file tree Collapse file tree 1 file changed +1
-30
lines changed Original file line number Diff line number Diff line change 55" @vorsteh-queue/core " : minor
66---
77
8- ## Dynamic Schema & Table Names
8+ ** Dynamic Schema & Table Names**
99
1010- All adapters (Drizzle, Kysely, Prisma) now support configurable schema and table names for queue jobs.
1111- Enables an easier integration in existing DB setups.
12-
13- ## Example: Drizzle Adapter with Custom Schema & Table
14-
15- ``` typescript
16- // drizzle-schema.ts
17- import { createQueueJobsTable } from " @vorsteh-queue/adapter-drizzle"
18-
19- export const { table : customQueueJobs, schema : customSchema } = createQueueJobsTable (
20- " custom_queue_jobs" ,
21- " custom_schema" ,
22- )
23-
24- // queue.ts
25- import { drizzle } from " drizzle-orm/node-postgres"
26- import { Pool } from " pg"
27- import * as schema from " src/drizzle-schema.ts2
28-
29- import { PostgresQueueAdapter } from " @vorsteh-queue/adapter-drizzle"
30-
31- const pool = new Pool ({ connectionString: process .env .DATABASE_URL })
32- const db = drizzle (pool , { schema })
33-
34- const adapter = new PostgresQueueAdapter (db , {
35- modelName: " customQueueJobs" ,
36- })
37-
38- // The queue will now use the specified schema and table
39- const queue = new Queue (adapter , { name: " my-queue" })
40- ```
You can’t perform that action at this time.
0 commit comments