Skip to content

Commit b03d5b4

Browse files
committed
update changeset
1 parent e1791ca commit b03d5b4

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

.changeset/crazy-colts-march.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@
55
"@vorsteh-queue/core": minor
66
---
77

8-
## Highlights
8+
## Dynamic Schema & Table Names
99

10-
- **Dynamic Schema & Table Names:**
11-
- All adapters (Drizzle, Kysely, Prisma) now support configurable schema and table names for queue jobs.
12-
- Enables an easier integration in existing DB setups.
13-
14-
- **Type-Safe Adapter Results:**
15-
- Adapter methods use improved type inference for job rows/results, even with dynamic models.
16-
- Ensures type safety for all job operations and migrations.
10+
- All adapters (Drizzle, Kysely, Prisma) now support configurable schema and table names for queue jobs.
11+
- Enables an easier integration in existing DB setups.
1712

1813
## Example: Drizzle Adapter with Custom Schema & Table
1914

2015
```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
2125
import { drizzle } from "drizzle-orm/node-postgres"
2226
import { Pool } from "pg"
27+
import * as schema from "src/drizzle-schema.ts2
2328

2429
import { PostgresQueueAdapter } from "@vorsteh-queue/adapter-drizzle"
2530

2631
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
27-
const db = drizzle(pool)
32+
const db = drizzle(pool, { schema })
2833

2934
const adapter = new PostgresQueueAdapter(db, {
3035
modelName: "customQueueJobs",
31-
schemaName: "custom_schema",
32-
tableName: "custom_queue_jobs",
3336
})
3437

3538
// The queue will now use the specified schema and table

0 commit comments

Comments
 (0)